本文整理汇总了Java中com.bulenkov.darcula.DarculaLaf类的典型用法代码示例。如果您正苦于以下问题:Java DarculaLaf类的具体用法?Java DarculaLaf怎么用?Java DarculaLaf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DarculaLaf类属于com.bulenkov.darcula包,在下文中一共展示了DarculaLaf类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: VisualEditorRoot
import com.bulenkov.darcula.DarculaLaf; //导入依赖的package包/类
public VisualEditorRoot(EditorRootConfig<T> config) {
this.config = config;
this.gameWorld = config.gameWorld;
this.shaderEditor = new ShaderEditor<>(config.gameWorld);
this.objectEditor = new ObjectEditor<>(config.gameWorld);
onResize = this::resize;
keyPressListener = new InputListener(){
@Override
public boolean keyDown(InputEvent event, int keycode) {
if(keycode == keyCode) {
if(Gdx.input.isKeyPressed(requiredModifier) || requiredModifier <= -1)
SwingUtilities.invokeLater(() -> openEditor());
}
return super.keyDown(event, keycode);
}
};
installLookAndFeel("Darcula", DarculaLaf.class);
recentEditor = this;
}
开发者ID:ncguy2,项目名称:Argent,代码行数:21,代码来源:VisualEditorRoot.java
示例2: createLookAndFeelMenu
import com.bulenkov.darcula.DarculaLaf; //导入依赖的package包/类
protected JMenu createLookAndFeelMenu() {
JMenu menu = new JMenu();
menu.setName("lookAndFeel");
// Look for toolkit look and feels first
UIManager.LookAndFeelInfo lookAndFeelInfos[] = UIManager.getInstalledLookAndFeels();
lookAndFeel = UIManager.getLookAndFeel().getClass().getName();
lookAndFeelRadioGroup = new ButtonGroup();
menu.add(createLookAndFeelItem(new DarculaLookAndFeelInfo().getName(), DarculaLaf.class.getName()));
for(UIManager.LookAndFeelInfo lafInfo: lookAndFeelInfos) {
menu.add(createLookAndFeelItem(lafInfo.getName(), lafInfo.getClassName()));
}
// Now load any look and feels defined externally as service via java.util.ServiceLoader
LOOK_AND_FEEL_LOADER.iterator();
for (LookAndFeel laf : LOOK_AND_FEEL_LOADER) {
menu.add(createLookAndFeelItem(laf.getName(), laf.getClass().getName()));
}
return menu;
}
开发者ID:bulenkov,项目名称:Darcula,代码行数:21,代码来源:SwingSet3.java
示例3: setDarculaLookAndFeel
import com.bulenkov.darcula.DarculaLaf; //导入依赖的package包/类
public static void setDarculaLookAndFeel()
{
try
{
UIManager.setLookAndFeel(new DarculaLaf());
}
catch (UnsupportedLookAndFeelException e)
{
}
}
开发者ID:alessandrojean,项目名称:manga-no-keiei,代码行数:11,代码来源:LookAndFeelUtils.java
示例4: main
import com.bulenkov.darcula.DarculaLaf; //导入依赖的package包/类
public static void main(String[] args) throws UnsupportedLookAndFeelException {
UIManager.setLookAndFeel(new DarculaLaf());
JFrame f = new JFrame("Combo boxes");
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
Container contentPane = f.getContentPane();
JLabel label = new JLabel();
JComboBox comboBox = new JComboBox();
JTextField textField = new JTextField();
JComboBox comboBox2 = new JComboBox();
JButton button = new JButton();
JComboBox comboBox3 = new JComboBox();
JTextArea textArea = new JTextArea();
JComboBox comboBox4 = new JComboBox();
label.setText("label");
comboBox.setModel(new DefaultComboBoxModel(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
textField.setText("textfield");
comboBox2.setModel(new DefaultComboBoxModel(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
button.setText("button");
comboBox3.setModel(new DefaultComboBoxModel(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
textArea.setRows(5);
textArea.setColumns(10);
textArea.setText("textArea\nother text\nanother text");
comboBox4.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
GroupLayout layout = new GroupLayout(contentPane);
contentPane.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(label)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(button)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBox3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(textArea, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBox4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label)
.addComponent(comboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(button)
.addComponent(comboBox3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(textArea, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(comboBox4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
f.pack();
f.setVisible(true);
System.out.printf("comboBox baseline %d%n",comboBox.getBaseline(comboBox.getWidth(), comboBox3.getHeight()));
System.out.printf("comboBox baseline resize behaviour %s%n", comboBox.getBaselineResizeBehavior());
}
开发者ID:bulenkov,项目名称:Darcula,代码行数:77,代码来源:ComboDemo.java
注:本文中的com.bulenkov.darcula.DarculaLaf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论