Browse Source

面板接口

master
eason-skx 7 years ago
parent
commit
4e827e5f24
  1. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  2. 11
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

4
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -17,6 +17,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -238,6 +239,9 @@ public class ChartTypePane extends AbstractChartAttrPane{
for (int i = 0; i < this.cards.size(); i++) { for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i); FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) { if (pane.accept(ob)) {
GUICoreUtils.setEnabled(this, ob.isValidPlot());
pane.populateBean(ob); pane.populateBean(ob);
Object item = pane.title4PopupWindow(); Object item = pane.title4PopupWindow();
for (int j = 0; j < cardNames.length; j++) { for (int j = 0; j < cardNames.length; j++) {

11
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -43,6 +43,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
protected List<ChartImagePane> styleList; protected List<ChartImagePane> styleList;
protected JPanel stylePane; //样式布局的面板 protected JPanel stylePane; //样式布局的面板
protected JPanel typePane;
protected abstract String[] getTypeIconPath(); protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName(); protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath(); protected abstract String[] getTypeLayoutPath();
@ -70,10 +71,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
checkDemosBackground(); checkDemosBackground();
JPanel typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4); this.typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
for(int i = 0; i < typeDemo.size(); i++) { for(int i = 0; i < typeDemo.size(); i++) {
ChartImagePane tmp = typeDemo.get(i); ChartImagePane tmp = typeDemo.get(i);
typePane.add(tmp); this.typePane.add(tmp);
tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()])); tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()]));
} }
@ -99,7 +100,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
stylePane.setVisible(false); stylePane.setVisible(false);
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(typePane),rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(this.typePane),rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
} }
@ -586,6 +587,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
&& chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE; && chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE;
} }
protected JPanel getTypePane(){
return this.typePane;
}
public Chart getDefaultChart() { public Chart getDefaultChart() {
return BarIndependentChart.barChartTypes[0]; return BarIndependentChart.barChartTypes[0];
} }

Loading…
Cancel
Save