|
|
@ -10,6 +10,7 @@ import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.SwingConstants; |
|
|
|
import javax.swing.SwingConstants; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
@ -45,23 +46,28 @@ public class WidgetBoundsPaneFactory { |
|
|
|
|
|
|
|
|
|
|
|
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, JComponent ratioLocked) { |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), |
|
|
|
|
|
|
|
ratioLocked != null ? createRightPane(width, ratioLocked, height) : 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}; |
|
|
|
double[] columnSize = {f, RIGHT_PANE_WIDTH}; |
|
|
|
double[] columnSize = {f, RIGHT_PANE_WIDTH}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = ratioLocked != null ? new int[][]{{1, 1}, {1, 1, 1}} : new int[][]{{1, 1}, {1, 1}}; |
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
boundsPane.add(panel); |
|
|
|
boundsPane.add(panel); |
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); |
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { |
|
|
|
|
|
|
|
return createBoundsPane(width, height, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static JPanel createRightPane(Component com1, Component com2) { |
|
|
|
public static JPanel createRightPane(Component com1, Component com2) { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
@ -74,21 +80,41 @@ 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, NameAttribute nameAttribute) { |
|
|
|
public static JPanel createRightPane(Component com1, Component com2, Component com3) { |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
|
|
|
double[] columnSize = {f, 24, f}; |
|
|
|
|
|
|
|
int[][] rowCount = {{1, 1, 1}}; |
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{com1, com2, com3} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 0, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel positionLabel = FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()); |
|
|
|
|
|
|
|
UILabel xLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER); |
|
|
|
|
|
|
|
UILabel yLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel sizeLabel = FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()); |
|
|
|
|
|
|
|
UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER); |
|
|
|
|
|
|
|
UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] northComponents = new Component[][]{ |
|
|
|
Component[][] northComponents = new Component[][]{ |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()), createRightPane(x, y)}, |
|
|
|
new Component[]{positionLabel, ratioLocked != null ? createRightPane(x, null, y) : 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, ratioLocked != null ? createRightPane(xLabel, null, yLabel) : createRightPane(xLabel, yLabel)}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
Component[][] centerComponents = new Component[][]{ |
|
|
|
Component[][] centerComponents = new Component[][]{ |
|
|
|
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), createRightPane(width, height)}, |
|
|
|
new Component[]{sizeLabel, ratioLocked != null ? createRightPane(width, ratioLocked, height) : 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, ratioLocked != null ? createRightPane(widthLabel, null, heightLabel) : createRightPane(widthLabel, heightLabel)}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] columnSize = {f, RIGHT_PANE_WIDTH}; |
|
|
|
double[] columnSize = {f, RIGHT_PANE_WIDTH}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = ratioLocked != null ? new int[][]{{1, 1, 1}, {1, 1, 1}} : new int[][]{{1, 1}, {1, 1}}; |
|
|
|
final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
@ -99,6 +125,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, NameAttribute nameAttribute) { |
|
|
|
|
|
|
|
return createAbsoluteBoundsPane(x, y, width, height, null, nameAttribute); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { |
|
|
|
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { |
|
|
|
return createAbsoluteBoundsPane(x, y, width, height, NameAttribute.DEFAULT); |
|
|
|
return createAbsoluteBoundsPane(x, y, width, height, NameAttribute.DEFAULT); |
|
|
|
} |
|
|
|
} |
|
|
|