Browse Source

事件坐标轴 常规项要显示成自动

master
fr_shine 8 years ago
parent
commit
d72aeba63d
  1. 25
      designer_base/src/com/fr/design/gui/style/FormatPane.java

25
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -4,10 +4,10 @@ import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -81,16 +81,7 @@ public class FormatPane extends AbstractBasicStylePane {
};
typeComboBox = new UIComboBox(types);
UIComboBoxRenderer render = new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Integer) {
label.setText(" " + FormatField.getInstance().getName((Integer) value));
}
return label;
}
};
UIComboBoxRenderer render = createComBoxRender();
typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener);
contentPane.add(sampleLabel, BorderLayout.NORTH);
@ -114,6 +105,18 @@ public class FormatPane extends AbstractBasicStylePane {
}
protected UIComboBoxRenderer createComBoxRender(){
return new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Integer) {
label.setText(" " + FormatField.getInstance().getName((Integer) value));
}
return label;
}
};
}
private void iniSampleLable() {
Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);

Loading…
Cancel
Save