forked from fanruan/design
hzzz
7 years ago
38 changed files with 4064 additions and 3738 deletions
@ -1,45 +1,70 @@ |
|||||||
package com.fr.design.widget.ui; |
package com.fr.design.widget.ui; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
import java.awt.event.KeyListener; |
import java.awt.event.KeyListener; |
||||||
|
|
||||||
|
import com.fr.design.constants.LayoutConstants; |
||||||
import com.fr.design.gui.ilable.UILabel; |
import com.fr.design.gui.ilable.UILabel; |
||||||
|
|
||||||
import javax.swing.*; |
import javax.swing.*; |
||||||
|
|
||||||
import com.fr.design.gui.itextfield.UITextField; |
import com.fr.design.gui.itextfield.UITextField; |
||||||
import com.fr.design.layout.FRGUIPaneFactory; |
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
import com.fr.form.ui.WaterMark; |
import com.fr.form.ui.WaterMark; |
||||||
import com.fr.general.Inter; |
import com.fr.general.Inter; |
||||||
|
|
||||||
public class WaterMarkDictPane extends JPanel{ |
public class WaterMarkDictPane extends JPanel { |
||||||
|
|
||||||
private UITextField waterMarkTextField; |
private UITextField waterMarkTextField; |
||||||
|
|
||||||
public WaterMarkDictPane() { |
public WaterMarkDictPane() { |
||||||
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
this.setLayout(new BorderLayout()); |
||||||
this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); |
|
||||||
this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); |
// this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
|
||||||
waterMarkTextField = new UITextField(13); |
// this.add(new UILabel(Inter.getLocText("WaterMark") + ":"));
|
||||||
this.add(waterMarkTextField); |
waterMarkTextField = new UITextField(13); |
||||||
} |
|
||||||
|
UILabel emptyLabel = new UILabel(); |
||||||
public void populate(WaterMark waterMark) { |
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 33, 0, 0)); |
||||||
this.waterMarkTextField.setText(waterMark.getWaterMark()); |
|
||||||
} |
double f = TableLayout.FILL; |
||||||
public void addInputKeyListener(KeyListener kl) { |
double p = TableLayout.PREFERRED; |
||||||
this.waterMarkTextField.addKeyListener(kl); |
Component[][] components = new Component[][]{ |
||||||
} |
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), emptyLabel, waterMarkTextField}, |
||||||
public void removeInputKeyListener(KeyListener kl) { |
}; |
||||||
this.waterMarkTextField.removeKeyListener(kl); |
double[] rowSize = {p}; |
||||||
} |
double[] columnSize = {p, p, f}; |
||||||
public void update(WaterMark waterMark) { |
int[][] rowCount = {{1, 1}}; |
||||||
waterMark.setWaterMark(this.waterMarkTextField.getText()); |
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
||||||
} |
// JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
|
||||||
public void setWaterMark(String waterMark) { |
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); |
||||||
this.waterMarkTextField.setText(waterMark); |
this.add(panel, BorderLayout.CENTER); |
||||||
} |
} |
||||||
public String getWaterMark() { |
|
||||||
return this.waterMarkTextField.getText(); |
public void populate(WaterMark waterMark) { |
||||||
} |
this.waterMarkTextField.setText(waterMark.getWaterMark()); |
||||||
|
} |
||||||
|
|
||||||
|
public void addInputKeyListener(KeyListener kl) { |
||||||
|
this.waterMarkTextField.addKeyListener(kl); |
||||||
|
} |
||||||
|
|
||||||
|
public void removeInputKeyListener(KeyListener kl) { |
||||||
|
this.waterMarkTextField.removeKeyListener(kl); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(WaterMark waterMark) { |
||||||
|
waterMark.setWaterMark(this.waterMarkTextField.getText()); |
||||||
|
} |
||||||
|
|
||||||
|
public void setWaterMark(String waterMark) { |
||||||
|
this.waterMarkTextField.setText(waterMark); |
||||||
|
} |
||||||
|
|
||||||
|
public String getWaterMark() { |
||||||
|
return this.waterMarkTextField.getText(); |
||||||
|
} |
||||||
|
|
||||||
} |
} |
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 177 B |
After Width: | Height: | Size: 165 B |
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.design.mainframe.widget; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.itextfield.UITextField; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2017/8/7. |
||||||
|
*/ |
||||||
|
public class BasicPropertyPane extends BasicPane { |
||||||
|
protected UITextField widgetName; |
||||||
|
|
||||||
|
public BasicPropertyPane(){ |
||||||
|
initContentPane(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initContentPane() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
widgetName = new UITextField(); |
||||||
|
|
||||||
|
double f = TableLayout.FILL; |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double[] rowSize = {p}; |
||||||
|
double[] columnSize = {p, f}; |
||||||
|
int[][] rowCount = {{1, 1}}; |
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName}, |
||||||
|
}; |
||||||
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); |
||||||
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); |
||||||
|
this.add(panel, BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
public UITextField getWidgetNameField() { |
||||||
|
return widgetName; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public String title4PopupWindow() { |
||||||
|
return "basicProperty"; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
package com.fr.design.widget; |
||||||
|
|
||||||
|
import com.fr.design.foldablepane.UIExpandablePane; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.ispinner.UISpinner; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2017/8/7. |
||||||
|
*/ |
||||||
|
public class WidgetBoundsPaneFactory { |
||||||
|
|
||||||
|
public static UIExpandablePane createBoundsPane(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_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)}, |
||||||
|
}; |
||||||
|
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, 5); |
||||||
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); |
||||||
|
|
||||||
|
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel); |
||||||
|
} |
||||||
|
|
||||||
|
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)}, |
||||||
|
}; |
||||||
|
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, 5); |
||||||
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); |
||||||
|
|
||||||
|
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue