|
|
@ -19,6 +19,35 @@ import java.awt.Component; |
|
|
|
* Created by plough on 2017/8/7. |
|
|
|
* Created by plough on 2017/8/7. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class WidgetBoundsPaneFactory { |
|
|
|
public class WidgetBoundsPaneFactory { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum NameAttribute { |
|
|
|
|
|
|
|
//默认的名称
|
|
|
|
|
|
|
|
DEFAULT(), |
|
|
|
|
|
|
|
//控件对应的名称
|
|
|
|
|
|
|
|
WIDGET(Toolkit.i18nText("Fine-Design_Basic_Widget_Position"),Toolkit.i18nText("Fine-Design_Basic_Widget_Size")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String positionName; |
|
|
|
|
|
|
|
private String sizeName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NameAttribute() { |
|
|
|
|
|
|
|
this.positionName = Toolkit.i18nText("Fine-Design_Basic_Component_Position"); |
|
|
|
|
|
|
|
this.sizeName = Toolkit.i18nText("Fine-Design_Basic_Component_Size"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NameAttribute(String positionName,String sizeName) { |
|
|
|
|
|
|
|
this.positionName = positionName; |
|
|
|
|
|
|
|
this.sizeName = sizeName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getPositionName() { |
|
|
|
|
|
|
|
return positionName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getSizeName() { |
|
|
|
|
|
|
|
return sizeName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final int RIGHT_PANE_WIDTH = 145; |
|
|
|
private static final int RIGHT_PANE_WIDTH = 145; |
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { |
|
|
|
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { |
|
|
@ -49,16 +78,16 @@ public class WidgetBoundsPaneFactory { |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1); |
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { |
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height,NameAttribute nameAttribute) { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] northComponents = new Component[][]{ |
|
|
|
Component[][] northComponents = new Component[][]{ |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Position")), createRightPane(x, y)}, |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()), createRightPane(x, y)}, |
|
|
|
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, |
|
|
|
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
Component[][] centerComponents = new Component[][]{ |
|
|
|
Component[][] centerComponents = new Component[][]{ |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)}, |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), createRightPane(width, height)}, |
|
|
|
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, |
|
|
|
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
@ -74,6 +103,10 @@ public class WidgetBoundsPaneFactory { |
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane); |
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { |
|
|
|
|
|
|
|
return createAbsoluteBoundsPane( x, y, width, height,NameAttribute.DEFAULT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createCardTagBoundPane(UISpinner width) { |
|
|
|
public static UIExpandablePane createCardTagBoundPane(UISpinner width) { |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|