use of javax.swing.plaf.ColorUIResource in project intellij-community by JetBrains.
the class IdeaLaf method initIdeaDefaults.
@SuppressWarnings({ "HardCodedStringLiteral" })
static void initIdeaDefaults(UIDefaults defaults) {
defaults.put("Menu.maxGutterIconWidth", 18);
defaults.put("MenuItem.maxGutterIconWidth", 18);
// TODO[vova,anton] REMOVE!!! INVESTIGATE??? Borland???
defaults.put("MenuItem.acceleratorDelimiter", "-");
defaults.put("TitledBorder.titleColor", IdeaBlueMetalTheme.primary1);
ColorUIResource col = new ColorUIResource(230, 230, 230);
defaults.put("ScrollBar.background", col);
defaults.put("ScrollBar.track", col);
//Border scrollPaneBorder = new BorderUIResource(new BegBorders.ScrollPaneBorder());
//defaults.put("ScrollPane.border", scrollPaneBorder);
defaults.put("TextField.border", BegBorders.getTextFieldBorder());
defaults.put("PasswordField.border", BegBorders.getTextFieldBorder());
Border popupMenuBorder = new BegPopupMenuBorder();
defaults.put("PopupMenu.border", popupMenuBorder);
defaults.put("ScrollPane.border", BegBorders.getScrollPaneBorder());
defaults.put("ButtonUI", BegButtonUI.class.getName());
defaults.put("ToggleButtonUI", BegToggleButtonUI.class.getName());
defaults.put("ComboBoxUI", BegComboBoxUI.class.getName());
defaults.put("RadioButtonUI", BegRadioButtonUI.class.getName());
defaults.put("CheckBoxUI", BegCheckBoxUI.class.getName());
defaults.put("TabbedPaneUI", BegTabbedPaneUI.class.getName());
defaults.put("TableUI", BegTableUI.class.getName());
defaults.put("TreeUI", BegTreeUI.class.getName());
//defaults.put("ScrollPaneUI", BegScrollPaneUI.class.getName());
defaults.put("TabbedPane.tabInsets", new Insets(0, 4, 0, 4));
defaults.put("ToolTip.background", TOOLTIP_BACKGROUND_COLOR);
defaults.put("ToolTip.border", new ColoredSideBorder(Color.gray, Color.gray, Color.black, Color.black, 1));
defaults.put("Tree.ancestorInputMap", null);
defaults.put("FileView.directoryIcon", AllIcons.Nodes.Folder);
defaults.put("FileChooser.upFolderIcon", AllIcons.Nodes.UpFolder);
defaults.put("FileChooser.newFolderIcon", AllIcons.Nodes.NewFolder);
defaults.put("FileChooser.homeFolderIcon", AllIcons.Nodes.HomeFolder);
defaults.put("OptionPane.errorIcon", AllIcons.General.ErrorDialog);
defaults.put("OptionPane.informationIcon", AllIcons.General.InformationDialog);
defaults.put("OptionPane.warningIcon", AllIcons.General.WarningDialog);
defaults.put("OptionPane.questionIcon", AllIcons.General.QuestionDialog);
defaults.put("Tree.openIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class, "icons/TreeOpen.gif"));
defaults.put("Tree.closedIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class, "icons/TreeClosed.gif"));
defaults.put("Tree.leafIcon", LookAndFeel.makeIcon(WindowsLookAndFeel.class, "icons/TreeLeaf.gif"));
defaults.put("Tree.expandedIcon", WindowsTreeUI.ExpandedIcon.createExpandedIcon());
defaults.put("Tree.collapsedIcon", WindowsTreeUI.CollapsedIcon.createCollapsedIcon());
defaults.put("Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { "ctrl C", "copy", "ctrl V", "paste", "ctrl X", "cut", "COPY", "copy", "PASTE", "paste", "CUT", "cut", "control INSERT", "copy", "shift INSERT", "paste", "shift DELETE", "cut", "RIGHT", "selectNextColumn", "KP_RIGHT", "selectNextColumn", "LEFT", "selectPreviousColumn", "KP_LEFT", "selectPreviousColumn", "DOWN", "selectNextRow", "KP_DOWN", "selectNextRow", "UP", "selectPreviousRow", "KP_UP", "selectPreviousRow", "shift RIGHT", "selectNextColumnExtendSelection", "shift KP_RIGHT", "selectNextColumnExtendSelection", "shift LEFT", "selectPreviousColumnExtendSelection", "shift KP_LEFT", "selectPreviousColumnExtendSelection", "shift DOWN", "selectNextRowExtendSelection", "shift KP_DOWN", "selectNextRowExtendSelection", "shift UP", "selectPreviousRowExtendSelection", "shift KP_UP", "selectPreviousRowExtendSelection", "PAGE_UP", "scrollUpChangeSelection", "PAGE_DOWN", "scrollDownChangeSelection", "HOME", "selectFirstColumn", "END", "selectLastColumn", "shift PAGE_UP", "scrollUpExtendSelection", "shift PAGE_DOWN", "scrollDownExtendSelection", "shift HOME", "selectFirstColumnExtendSelection", "shift END", "selectLastColumnExtendSelection", "ctrl PAGE_UP", "scrollLeftChangeSelection", "ctrl PAGE_DOWN", "scrollRightChangeSelection", "ctrl HOME", "selectFirstRow", "ctrl END", "selectLastRow", "ctrl shift PAGE_UP", "scrollRightExtendSelection", "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", "ctrl shift HOME", "selectFirstRowExtendSelection", "ctrl shift END", "selectLastRowExtendSelection", "TAB", "selectNextColumnCell", "shift TAB", "selectPreviousColumnCell", //"ENTER", "selectNextRowCell",
"shift ENTER", "selectPreviousRowCell", "ctrl A", "selectAll", //"ESCAPE", "cancel",
"F2", "startEditing" }));
}
use of javax.swing.plaf.ColorUIResource in project adempiere by adempiere.
the class AdempiereTaskPaneUI method update.
/**
* Overriden to paint the background of the component but keeping the
* rounded corners.
*/
public void update(Graphics g, JComponent c) {
if (c.isOpaque()) {
g.setColor(new ColorUIResource(251, 248, 241));
g.fillRect(0, 0, c.getWidth(), c.getHeight());
g.setColor(new ColorUIResource(251, 248, 241));
g.fillRect(0, getRoundHeight(), c.getWidth(), c.getHeight() - getRoundHeight());
}
paint(g, c);
}
use of javax.swing.plaf.ColorUIResource in project adempiere by adempiere.
the class Info method jbInit.
/**
* Static Init
* @throws Exception
*/
protected void jbInit() throws Exception {
this.getContentPane().add(parameterPanel, BorderLayout.NORTH);
this.getContentPane().add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(southPanel, BorderLayout.SOUTH);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//
AppsAction aa = new AppsAction(ConfirmPanel.A_RESET, null, "reset");
bReset = (CButton) aa.getButton();
bReset.setMargin(ConfirmPanel.s_insets);
bReset.setSize(bReset.getHeight(), bReset.getHeight());
Dimension bSize = bReset.getSize();
bSize.height = bReset.getHeight();
bSize.width = bReset.getHeight();
// Make it square
bReset.setMaximumSize(bSize);
bReset.addActionListener(this);
//
buttonPanel = new CPanel(new FlowLayout(FlowLayout.LEFT));
buttonPanel.add(bReset, FlowLayout.LEFT);
//
// p_criteriaGrid is filled by the subordinate class
p_criteriaGrid.setLayout(new ALayout());
//
parameterPanel.setLayout(new BorderLayout());
parameterPanel.add(buttonPanel, BorderLayout.WEST);
parameterPanel.add(p_criteriaGrid, BorderLayout.CENTER);
//
// Setup the detail panel if used
p_detailTaskPane.setVisible(false);
p_detailTaskPane.setCollapsed(true);
p_detailTaskPane.setLayout(new BorderLayout());
p_detailTaskPane.setUI(new AdempiereTaskPaneUI());
p_detailTaskPane.getContentPane().setBackground(new ColorUIResource(251, 248, 241));
p_detailTaskPane.getContentPane().setForeground(new ColorUIResource(251, 0, 0));
addonPanel.setLayout(new BorderLayout());
// Allow auto resizing of the panel
addonPanel.add(p_detailTaskPane, BorderLayout.CENTER);
southPanel.setLayout(southLayout);
southPanel.add(addonPanel, BorderLayout.NORTH);
southPanel.add(confirmPanel, BorderLayout.CENTER);
southPanel.add(statusBar, BorderLayout.SOUTH);
scrollPane.getViewport().add(p_table, null);
//
confirmPanel.addActionListener(this);
confirmPanel.getResetButton().setVisible(hasReset());
confirmPanel.getCustomizeButton().setVisible(hasCustomize());
confirmPanel.getHistoryButton().setVisible(hasHistory());
confirmPanel.getZoomButton().setVisible(hasZoom());
// Only show the OK button if we intend to save
confirmPanel.setOKVisible(p_saveResults);
//
JButton print = ConfirmPanel.createPrintButton(true);
print.addActionListener(this);
confirmPanel.addButton(print);
//
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.addActionListener(this);
// Index 0 is OK-Cancel on the right
CPanel leftButtons = (CPanel) confirmPanel.getComponent(1);
// Add the check box on the very left before the refresh icon
leftButtons.add(checkAutoQuery, 0);
//
popup.add(zoomMenu);
zoomMenu.setText(Msg.getMsg(Env.getCtx(), "Zoom"));
zoomMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Zoom16.gif")));
zoomMenu.addActionListener(this);
//
popup.add(calcMenu);
calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator"));
calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Calculator16.gif")));
calcMenu.addActionListener(this);
//
// Table Selection (Invoked before setting column class so that row selection is enabled)
p_table.setKeyColumnIndex(-1);
p_table.setCellSelectionEnabled(false);
p_table.setColumnSelectionAllowed(false);
p_table.setRowSelectionAllowed(true);
// Override the Enter key input and action map
if (p_saveResults) {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doDispose");
} else {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doNothing");
}
p_table.getActionMap().put("doDispose", doDispose);
// To enable buttons
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
p_table.addMouseListener(this);
// Listen to changes in the table
p_table.addPropertyChangeListener("p_table_update", this);
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
//
// Set default location where focus will go. See property change listener.
m_parentPanel = p_criteriaGrid;
//
enableButtons();
}
use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.
the class PropertiesMetalTheme method parseColor.
/**
* parse a comma delimited list of 3 strings into a Color
*/
private ColorUIResource parseColor(String s) {
int red = 0;
int green = 0;
int blue = 0;
try {
StringTokenizer st = new StringTokenizer(s, ",");
red = Integer.parseInt(st.nextToken());
green = Integer.parseInt(st.nextToken());
blue = Integer.parseInt(st.nextToken());
} catch (Exception e) {
System.out.println(e);
System.out.println("Couldn't parse color :" + s);
}
return new ColorUIResource(red, green, blue);
}
use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.
the class ColorCustomizationTest method testNames.
void testNames() {
Color defaultColor = label.getBackground();
UIManager.put("\"BlueLabel\"[Enabled].background", new ColorUIResource(Color.BLUE));
UIManager.put("\"RedLabel\"[Enabled].background", new ColorUIResource(Color.RED));
nimbus.register(Region.LABEL, "\"BlueLabel\"");
nimbus.register(Region.LABEL, "\"RedLabel\"");
label.setName("BlueLabel");
check(Color.BLUE);
label.setName("RedLabel");
check(Color.RED);
// remove name, color goes back to default
label.setName(null);
check(defaultColor);
}
Aggregations