本文整理汇总了Java中com.l2fprod.common.swing.LookAndFeelTweaks类的典型用法代码示例。如果您正苦于以下问题:Java LookAndFeelTweaks类的具体用法?Java LookAndFeelTweaks怎么用?Java LookAndFeelTweaks使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LookAndFeelTweaks类属于com.l2fprod.common.swing包,在下文中一共展示了LookAndFeelTweaks类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ChooseDirectory
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public ChooseDirectory() {
setLayout(new PercentLayout(PercentLayout.VERTICAL, 3));
if (System.getProperty("javawebstart.version") != null) {
JTextArea area = new JTextArea(RESOURCE.getString("message.webstart"));
LookAndFeelTweaks.makeMultilineLabel(area);
add(area);
}
final JButton button = new JButton(RESOURCE.getString("selectDirectory"));
add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectDirectory(button, null);
}
});
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:18,代码来源:ChooseDirectory.java
示例2: NumberPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public NumberPropertyEditor(Class type) {
if (!Number.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JFormattedTextField();
this.type = type;
((JFormattedTextField)editor).setValue(getDefaultValue());
((JFormattedTextField)editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
// use a custom formatter to have numbers with up to 64 decimals
NumberFormat format = NumberConverters.getDefaultFormat();
((JFormattedTextField) editor).setFormatterFactory(
new DefaultFormatterFactory(new NumberFormatter(format))
);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:18,代码来源:NumberPropertyEditor.java
示例3: ConfigurationPropertySheetPage
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public ConfigurationPropertySheetPage() {
setLayout(LookAndFeelTweaks.createVerticalPercentLayout());
JTextArea message = new JTextArea();
message.setText("Configuration");
LookAndFeelTweaks.makeMultilineLabel(message);
add(message);
final ConfigurationBean data = new ConfigurationBean();
final PropertySheetPanel sheet = new PropertySheetPanel();
sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
sheet.setDescriptionVisible(true);
sheet.setSortingCategories(true);
sheet.setSortingProperties(true);
sheet.setRestoreToggleStates(true);
add(sheet, "*");
// everytime a property change, update the sheet with it
new BeanBinder(data, sheet);
}
开发者ID:dvorka,项目名称:mindraider,代码行数:22,代码来源:ConfigurationPropertySheetPage.java
示例4: NumberPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public NumberPropertyEditor(Class<?> type) {
if (!Number.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JFormattedTextField();
this.type = type;
((JFormattedTextField) editor).setValue(getDefaultValue());
((JFormattedTextField) editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
// use a custom formatter to have numbers with up to 64 decimals
NumberFormat format = NumberConverters.DEFAULT_FORMAT;
((JFormattedTextField) editor).setFormatterFactory(
new DefaultFormatterFactory(new NumberFormatter(format))
);
}
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:18,代码来源:NumberPropertyEditor.java
示例5: BigIntegerEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public BigIntegerEditor() {
Class t = BigInteger.class;
if (!Number.class.isAssignableFrom(t)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JFormattedTextField();
this.type = t;
((JFormattedTextField) editor).setValue(getDefaultValue());
((JFormattedTextField) editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
// use a custom formatter to have numbers with up to 64 decimals
format = NumberConverters.getDefaultFormat();
((JFormattedTextField) editor).setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(format)));
}
开发者ID:jurgendl,项目名称:hql-builder,代码行数:17,代码来源:PropertyPanel.java
示例6: BigDecimalEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public BigDecimalEditor() {
Class t = BigDecimal.class;
if (!Number.class.isAssignableFrom(t)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JFormattedTextField();
this.type = t;
((JFormattedTextField) editor).setValue(getDefaultValue());
((JFormattedTextField) editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
// use a custom formatter to have numbers with up to 64 decimals
format = NumberConverters.getDefaultFormat();
((JFormattedTextField) editor).setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(format)));
}
开发者ID:jurgendl,项目名称:hql-builder,代码行数:17,代码来源:PropertyPanel.java
示例7: main
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
LookAndFeelTweaks.tweak();
JFrame frame = new JFrame("PropertySheet");
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add("Center", new PropertySheetMain());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocation(100, 100);
frame.setVisible(true);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:13,代码来源:PropertySheetMain.java
示例8: PropertySheetPage
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public PropertySheetPage() {
setLayout(LookAndFeelTweaks.createVerticalPercentLayout());
JTextArea message = new JTextArea();
message.setText(PropertySheetMain.RESOURCE.getString("Main.sheet1.message"));
LookAndFeelTweaks.makeMultilineLabel(message);
add(message);
final Bean data = new Bean();
data.setName("John Smith");
data.setText("Any text here");
data.setColor(Color.green);
data.setPath(new File("."));
data.setVisible(true);
data.setTime(System.currentTimeMillis());
DefaultBeanInfoResolver resolver = new DefaultBeanInfoResolver();
BeanInfo beanInfo = resolver.getBeanInfo(data);
PropertySheetPanel sheet = new PropertySheetPanel();
sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
sheet.setProperties(beanInfo.getPropertyDescriptors());
sheet.readFromObject(data);
sheet.setDescriptionVisible(true);
sheet.setSortingCategories(true);
sheet.setSortingProperties(true);
add(sheet, "*");
// everytime a property change, update the button with it
PropertyChangeListener listener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
Property prop = (Property)evt.getSource();
prop.writeToObject(data);
System.out.println("Updated object to " + data);
}
};
sheet.addPropertySheetChangeListener(listener);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:39,代码来源:PropertySheetPage.java
示例9: FilePropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public FilePropertyEditor() {
editor = new JPanel(new BorderLayout(0, 0));
((JPanel)editor).add("Center", textfield = new JTextField());
((JPanel)editor).add("East", button = new FixedButton());
textfield.setBorder(LookAndFeelTweaks.EMPTY_BORDER);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
selectFile();
}
});
textfield.setTransferHandler(new FileTransferHandler());
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:14,代码来源:FilePropertyEditor.java
示例10: NumberPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public NumberPropertyEditor(Class type) {
if (!Number.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JFormattedTextField();
this.type = type;
((JFormattedTextField) editor).setValue(getDefaultValue());
((JFormattedTextField) editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
// use a custom formatter to have numbers with up to 64 decimals
NumberFormat format = NumberConverters.getDefaultFormat();
((JFormattedTextField) editor).setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(format)));
}
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:16,代码来源:NumberPropertyEditor.java
示例11: main
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
LookAndFeelTweaks.tweak();
JFrame frame = new JFrame("PropertySheet");
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add("Center", new PropertySheetMain());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocation(100, 100);
frame.setVisible(true);
}
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:13,代码来源:PropertySheetMain.java
示例12: PropertySheetPage
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
@SuppressWarnings("OverridableMethodCallInConstructor")
public PropertySheetPage() {
setLayout(LookAndFeelTweaks.createVerticalPercentLayout());
JTextArea message = new JTextArea();
message.setText(PropertySheetMain.RESOURCE.getString("Main.sheet1.message"));
LookAndFeelTweaks.makeMultilineLabel(message);
add(message);
final Bean data = new Bean();
data.setName("John Smith");
data.setText("Any text here");
data.setColor(Color.green);
data.setPath(new File("."));
data.setVisible(true);
data.setTime(System.currentTimeMillis());
data.setCalendar(java.util.Calendar.getInstance());
final PropertySheetPanel sheet = new PropertySheetPanel();
sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
sheet.setDescriptionVisible(true);
sheet.setSortingCategories(true);
sheet.setSortingProperties(true);
sheet.setRestoreToggleStates(true);
add(sheet, "*");
// everytime a property change, update the sheet with it
new BeanBinder(data, sheet);
}
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:30,代码来源:PropertySheetPage.java
示例13: FilePropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public FilePropertyEditor(boolean asTableEditor) {
editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0)) {
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
textfield.setEnabled(enabled);
button.setEnabled(enabled);
// cancelButton.setEnabled(enabled);
}
};
((JPanel) editor).add("*", textfield = new JTextField());
((JPanel) editor).add(button = ComponentFactory.Helper.getFactory()
.createMiniButton());
if (asTableEditor) {
textfield.setBorder(LookAndFeelTweaks.EMPTY_BORDER);
}
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
selectFile();
}
});
// ((JPanel) editor).add(cancelButton = ComponentFactory.Helper.getFactory()
// .createMiniButton());
// cancelButton.setText("X");
// cancelButton.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// selectNull();
// }
// });
textfield.setTransferHandler(new FileTransferHandler());
}
开发者ID:ZenHarbinger,项目名称:l2fprod-properties-editor,代码行数:34,代码来源:FilePropertyEditor.java
示例14: SpinnerPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public SpinnerPropertyEditor(Class type) {
if (!Number.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("type must be a subclass of Number");
}
editor = new JSpinner(getModel());
this.type = type;
((JSpinner)editor).setValue(getDefaultValue());
((JSpinner)editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
}
开发者ID:macbury,项目名称:ForgE,代码行数:13,代码来源:SpinnerPropertyEditor.java
示例15: PropertySheetPage3
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public PropertySheetPage3()
{
setLayout( LookAndFeelTweaks.createVerticalPercentLayout() );
JTextArea message = new JTextArea();
message.setText( PropertySheetMain.RESOURCE.getString( "Main.sheet1.message" ) );
LookAndFeelTweaks.makeMultilineLabel( message );
add( message );
final Colorful data = new Colorful();
data.setColor( new Color( 255, 153, 102 ) );
DefaultProperty level0 = new NoReadWriteProperty();
level0.setDisplayName("Level 0");
level0.setCategory("A category");
DefaultProperty level1 = new NoReadWriteProperty();
level1.setDisplayName("Level 1");
level1.setCategory("Another category");
level0.addSubProperty(level1);
DefaultProperty level2 = new NoReadWriteProperty();
level2.setDisplayName("Level 2");
level1.addSubProperty(level2);
DefaultProperty level21 = new NoReadWriteProperty();
level21.setDisplayName("Level 3");
level1.addSubProperty(level21);
DefaultProperty level211 = new NoReadWriteProperty();
level211.setDisplayName("Level 3.1");
level21.addSubProperty(level211);
DefaultProperty root = new NoReadWriteProperty();
root.setDisplayName("Root");
final PropertySheetPanel sheet = new PropertySheetPanel();
sheet.setMode( PropertySheet.VIEW_AS_FLAT_LIST );
sheet.setProperties( new Property[] { new ColorProperty(), level0, root } );
sheet.readFromObject( data );
sheet.setDescriptionVisible( true );
sheet.setSortingCategories( true );
sheet.setSortingProperties( true );
add( sheet, "*" );
// everytime a property change, update the button with it
PropertyChangeListener listener = new PropertyChangeListener() {
public void propertyChange( PropertyChangeEvent evt )
{
Property prop = (Property) evt.getSource();
prop.writeToObject( data );
System.out.println( "Updated object to " + data );
}
};
sheet.addPropertySheetChangeListener( listener );
JButton button = new JButton(new AbstractAction("Click to setWantsExtraIndent(true)") {
public void actionPerformed(ActionEvent e) {
sheet.getTable().setWantsExtraIndent(!sheet.getTable().getWantsExtraIndent());
putValue(NAME, "Click to setWantsExtraIndent(" + !sheet.getTable().getWantsExtraIndent() + ")");
}
});
add(button);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:62,代码来源:PropertySheetPage3.java
示例16: DemoPanel
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public DemoPanel() {
JTaskPane taskPane = new JTaskPane();
// "System" GROUP
JTaskPaneGroup systemGroup = new JTaskPaneGroup();
systemGroup.setTitle(RESOURCE.getString("Main.tasks.systemGroup"));
systemGroup.setToolTipText(RESOURCE
.getString("Main.tasks.systemGroup.tooltip"));
systemGroup.setSpecial(true);
systemGroup.setIcon(new ImageIcon(TaskPaneMain.class
.getResource("icons/tasks-email.png")));
systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.email"), "",
"icons/tasks-email.png"));
systemGroup.add(makeAction(RESOURCE.getString("Main.tasks.delete"), "",
"icons/tasks-recycle.png"));
taskPane.add(systemGroup);
// "Office" GROUP
JTaskPaneGroup officeGroup = new JTaskPaneGroup();
officeGroup.setTitle(RESOURCE.getString("Main.tasks.office"));
officeGroup.add(makeAction(RESOURCE.getString("Main.tasks.word"), "",
"icons/tasks-writedoc.png"));
officeGroup.setExpanded(false);
officeGroup.setScrollOnExpand(true);
taskPane.add(officeGroup);
// "SEE ALSO" GROUP and ACTIONS
JTaskPaneGroup seeAlsoGroup = new JTaskPaneGroup();
seeAlsoGroup.setTitle(RESOURCE.getString("Main.tasks.seealso"));
seeAlsoGroup.add(makeAction("The Internet", RESOURCE
.getString("Main.tasks.internet.tooltip"), "icons/tasks-internet.png"));
seeAlsoGroup.add(makeAction(RESOURCE.getString("Main.tasks.help"),
RESOURCE.getString("Main.tasks.help.tooltip"),
"icons/tasks-question.png"));
taskPane.add(seeAlsoGroup);
// "Details" GROUP
JTaskPaneGroup detailsGroup = new JTaskPaneGroup();
detailsGroup.setTitle(RESOURCE.getString("Main.tasks.details"));
detailsGroup.setScrollOnExpand(true);
JEditorPane detailsText = new JEditorPane("text/html", "<html>");
LookAndFeelTweaks.makeMultilineLabel(detailsText);
LookAndFeelTweaks.htmlize(detailsText);
detailsText.setText(RESOURCE.getString("Main.tasks.details.message"));
detailsGroup.add(detailsText);
taskPane.add(detailsGroup);
JScrollPane scroll = new JScrollPane(taskPane);
scroll.setBorder(null);
setLayout(new BorderLayout());
add("Center", scroll);
setBorder(null);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:64,代码来源:TaskPaneMain.java
示例17: buildUI
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
private void buildUI() {
LookAndFeelTweaks.setBorderLayout(this);
LookAndFeelTweaks.setBorder(this);
actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0));
actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
add("North", actionPanel);
sortButton = new JToggleButton(new ToggleSortingAction());
sortButton.setUI(new BlueishButtonUI());
sortButton.setText(null);
actionPanel.add(sortButton);
asCategoryButton = new JToggleButton(new ToggleModeAction());
asCategoryButton.setUI(new BlueishButtonUI());
asCategoryButton.setText(null);
actionPanel.add(asCategoryButton);
descriptionButton = new JToggleButton(new ToggleDescriptionAction());
descriptionButton.setUI(new BlueishButtonUI());
descriptionButton.setText(null);
actionPanel.add(descriptionButton);
split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
split.setBorder(null);
split.setResizeWeight(1.0);
split.setContinuousLayout(true);
add("Center", split);
tableScroll = new JScrollPane();
split.setTopComponent(tableScroll);
descriptionPanel = new JEditorPane("text/html", "<html>");
descriptionPanel.setBorder(BorderFactory.createEmptyBorder());
descriptionPanel.setEditable(false);
descriptionPanel.setBackground(UIManager.getColor("Panel.background"));
LookAndFeelTweaks.htmlize(descriptionPanel);
selectionListener = new SelectionListener();
descriptionScrollPane = new JScrollPane(descriptionPanel);
descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory
.createLineBorder(UIManager.getColor("controlDkShadow"))));
descriptionScrollPane.getViewport().setBackground(
descriptionPanel.getBackground());
descriptionScrollPane.setMinimumSize(new Dimension(50, 50));
split.setBottomComponent(descriptionScrollPane);
// by default description is not visible, toolbar is visible.
setDescriptionVisible(false);
setToolBarVisible(true);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:53,代码来源:PropertySheetPanel.java
示例18: StringConverterPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public StringConverterPropertyEditor() {
editor = new JTextField();
((JTextField)editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:5,代码来源:StringConverterPropertyEditor.java
示例19: StringPropertyEditor
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public StringPropertyEditor() {
editor = new JTextField();
((JTextField)editor).setBorder(LookAndFeelTweaks.EMPTY_BORDER);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:5,代码来源:StringPropertyEditor.java
示例20: installComponents
import com.l2fprod.common.swing.LookAndFeelTweaks; //导入依赖的package包/类
public void installComponents(JFileChooser chooser) {
this.chooser = (JDirectoryChooser)chooser;
chooser.setLayout(LookAndFeelTweaks.createBorderLayout());
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
Component accessory = chooser.getAccessory();
if (accessory != null) {
chooser.add("North", chooser.getAccessory());
}
tree = new JTree() {
public String getToolTipText(MouseEvent event) {
String tip = WindowsDirectoryChooserUI.this.getToolTipText(event);
if (tip == null) {
return super.getToolTipText(event);
} else {
return tip;
}
}
};
tree.addTreeExpansionListener(new TreeExpansion());
tree.setModel(new FileSystemTreeModel(chooser.getFileSystemView()));
tree.setRootVisible(false);
tree.setShowsRootHandles(false);
tree.setCellRenderer(new FileSystemTreeRenderer());
tree.setToolTipText("");
chooser.add("Center", treeScroll = new JScrollPane(tree));
treeScroll.setPreferredSize(new Dimension(300, 300));
approveButton = new JButton();
approveButton.setAction(getApproveSelectionAction());
cancelButton = new JButton();
cancelButton.addActionListener(getCancelSelectionAction());
buttonPanel = new JPanel(LookAndFeelTweaks.createButtonAreaLayout());
buttonPanel.add(approveButton);
buttonPanel.add(cancelButton);
chooser.add("South", buttonPanel);
updateView(chooser);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:46,代码来源:WindowsDirectoryChooserUI.java
注:本文中的com.l2fprod.common.swing.LookAndFeelTweaks类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论