Browse Source

btn group

master
hzzz 7 years ago
parent
commit
554ca42e54
  1. 1
      designer_base/src/com/fr/design/constants/UIConstants.java
  2. 36
      designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

1
designer_base/src/com/fr/design/constants/UIConstants.java

@ -144,6 +144,7 @@ public interface UIConstants {
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233); public static final Color BARNOMAL = new Color(232, 232, 233);
public static final int ARC = 0; public static final int ARC = 0;
public static final int BUTTON_GROUP_ARC = 6;
public static final int LARGEARC = 6; public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0); public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png"); public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");

36
designer_base/src/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -1,5 +1,17 @@
package com.fr.design.gui.ibutton; package com.fr.design.gui.ibutton;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -10,22 +22,6 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver { public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
private boolean isTwoLine = false; private boolean isTwoLine = false;
private boolean isFourLine = false; private boolean isFourLine = false;
@ -82,11 +78,11 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
} }
} }
public boolean hasClick(){ public boolean hasClick() {
return isClick; return isClick;
} }
public void setClickState(boolean changeFlag){ public void setClickState(boolean changeFlag) {
isClick = changeFlag; isClick = changeFlag;
} }
@ -132,7 +128,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
if (!isEnabled()) { if (!isEnabled()) {
return; return;
} }
if(globalNameListener != null) { if (globalNameListener != null) {
globalNameListener.setGlobalName(buttonGroupName); globalNameListener.setGlobalName(buttonGroupName);
} }
setSelectedWithFireChanged(index); setSelectedWithFireChanged(index);
@ -201,7 +197,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
*/ */
@Override @Override
protected void paintBorder(Graphics g) { protected void paintBorder(Graphics g) {
if(isToolBarComponent){ if (isToolBarComponent) {
return; return;
} }
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;

Loading…
Cancel
Save