|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.design.widget; |
|
|
|
|
|
|
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
@ -21,32 +22,43 @@ public class WidgetBoundsPaneFactory {
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, |
|
|
|
|
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), createRightPane(width, height)}, |
|
|
|
|
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER))}, |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
double[] columnSize = {p, f, f}; |
|
|
|
|
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; |
|
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10); |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
boundsPane.add(panel); |
|
|
|
|
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, boundsPane); |
|
|
|
|
} |
|
|
|
|
public static JPanel createRightPane(Component com1, Component com2){ |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
double[] columnSize = {f, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{com1, com2} |
|
|
|
|
}; |
|
|
|
|
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) { |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y}, |
|
|
|
|
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, |
|
|
|
|
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), createRightPane(x, y)}, |
|
|
|
|
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER))}, |
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), createRightPane(width, height)}, |
|
|
|
|
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER))}, |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f, f}; |
|
|
|
|
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; |
|
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 10); |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
|
boundsPane.add(panel); |
|
|
|
|