Browse Source

format

master
hzzz 7 years ago
parent
commit
a52695fea6
  1. 2
      designer_base/src/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  2. 51
      designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java

2
designer_base/src/com/fr/design/gui/ibutton/UIBasicButtonUI.java

@ -5,9 +5,9 @@
package com.fr.design.gui.ibutton;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.general.ComparatorUtils;
import com.fr.design.utils.ColorRoutines;
import com.fr.design.utils.ThemeUtils;
import com.fr.general.ComparatorUtils;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;

51
designer_base/src/com/fr/design/gui/itoolbar/UIToolbar.java

@ -1,35 +1,38 @@
package com.fr.design.gui.itoolbar;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import javax.swing.JToolBar;
public class UIToolbar extends JToolBar {
private static final int TOOLBAR_HEIGNT = 26;
public class UIToolbar extends JToolBar{
private static final int TOOLBAR_HEIGNT = 26;
public UIToolbar() {
this(FlowLayout.LEFT);
}
public UIToolbar() {
this(FlowLayout.LEFT);
}
public UIToolbar(int align, UIToolBarUI uiToolBarUI) {
super();
setFloatable(false);
setRollover(true);
setLayout(new FlowLayout(align, 4, 0));
setUI(uiToolBarUI);
setBorderPainted(false);
}
public UIToolbar(int align) {
super();
setFloatable(false);
setRollover(true);
setLayout(new FlowLayout(align, 4, 0));
setUI(new UIToolBarUI());
setBorderPainted(false);
setBackground(Color.RED);
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = TOOLBAR_HEIGNT;
return dim;
}
public UIToolbar(int align) {
this(align, new UIToolBarUI());
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = TOOLBAR_HEIGNT;
return dim;
}
public void checkComponentsByNames (boolean flag, ArrayList<String> names) {
for (int i = 0; i < getComponentCount(); i ++) {
public void checkComponentsByNames(boolean flag, ArrayList<String> names) {
for (int i = 0; i < getComponentCount(); i++) {
Component component = getComponents()[i];
if (names.contains(component.getName())) {
component.setEnabled(flag);

Loading…
Cancel
Save