use of java.awt.Toolkit in project jdk8u_jdk by JetBrains.
the class AttributeValues method applyIMHighlight.
/**
* If this has an imHighlight, create copy of this with those attributes
* applied to it. Otherwise return this unchanged.
*/
public AttributeValues applyIMHighlight() {
if (imHighlight != null) {
InputMethodHighlight hl = null;
if (imHighlight instanceof InputMethodHighlight) {
hl = (InputMethodHighlight) imHighlight;
} else {
hl = (InputMethodHighlight) ((Annotation) imHighlight).getValue();
}
Map imStyles = hl.getStyle();
if (imStyles == null) {
Toolkit tk = Toolkit.getDefaultToolkit();
imStyles = tk.mapInputMethodHighlight(hl);
}
if (imStyles != null) {
return clone().merge(imStyles);
}
}
return this;
}
use of java.awt.Toolkit in project jdk8u_jdk by JetBrains.
the class SwingTest method start.
private void start() throws Throwable {
do {
if ((this.method != null) && Modifier.isStatic(this.method.getModifiers())) {
// invoke static method on the current thread
run();
} else {
// invoke on the event dispatch thread
SwingUtilities.invokeLater(this);
}
Toolkit tk = Toolkit.getDefaultToolkit();
if (tk instanceof SunToolkit) {
SunToolkit stk = (SunToolkit) tk;
// wait until done
stk.realSync();
}
} while (this.frame != null);
if (this.error != null) {
throw this.error;
}
}
use of java.awt.Toolkit in project knime-core by knime.
the class HierarchicalGraphComponent method paint.
/**
* {@inheritDoc}
*/
@Override
public void paint(final Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Toolkit tk = Toolkit.getDefaultToolkit();
@SuppressWarnings("rawtypes") Map desktopHints = (Map) (tk.getDesktopProperty("awt.font.desktophints"));
if (desktopHints != null) {
g2.addRenderingHints(desktopHints);
} else {
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
super.paint(g2);
m_graph.paint(this, g2, 0, 0, this.getWidth(), this.getHeight());
}
use of java.awt.Toolkit in project keystore-explorer by kaikramer.
the class KSE method fixAppClassName.
private static void fixAppClassName() {
// Fix application name in Gnome top bar, see http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6528430
Toolkit xToolkit = Toolkit.getDefaultToolkit();
try {
Field awtAppClassNameField = xToolkit.getClass().getDeclaredField("awtAppClassName");
awtAppClassNameField.setAccessible(true);
awtAppClassNameField.set(xToolkit, getApplicationName());
} catch (Exception x) {
// ignore
}
}
use of java.awt.Toolkit in project keystore-explorer by kaikramer.
the class JQuickStartPane method initComponents.
private void initComponents() {
jqslHeading = new JQuickStartLabel(res.getString("JQuickStartPane.jqslHeading.text"));
jqslHeading.setForeground(TEXT_COLOR);
jqslHeading.setFont(jqslHeading.getFont().deriveFont(20f));
Toolkit toolKit = Toolkit.getDefaultToolkit();
ImageIcon newImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbNewKeyStore.image"))));
ImageIcon newImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbNewKeyStore.rollover.image"))));
jqsbNewKeyStore = new JQuickStartButton(new NewAction(kseFrame), res.getString("JQuickStartPane.jqsbNewKeyStore.text"), newImage, newImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbNewKeyStore.setOpaque(false);
ImageIcon openImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenKeyStore.image"))));
ImageIcon openImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenKeyStore.rollover.image"))));
jqsbOpenKeyStore = new JQuickStartButton(new OpenAction(kseFrame), res.getString("JQuickStartPane.jqsbOpenKeyStore.text"), openImage, openImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbOpenKeyStore.setOpaque(false);
ImageIcon openDefaultImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenDefaultKeyStore.image"))));
ImageIcon openDefaultImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenDefaultKeyStore.rollover.image"))));
jqsbOpenDefaultKeyStore = new JQuickStartButton(new OpenDefaultAction(kseFrame), res.getString("JQuickStartPane.jqsbOpenDefaultKeyStore.text"), openDefaultImage, openDefaultImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbOpenDefaultKeyStore.setOpaque(false);
ImageIcon openCaCertificatesImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenCaCertificatesKeyStore.image"))));
ImageIcon openCaCertificatesImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbOpenCaCertificatesKeyStore.rollover.image"))));
jqsbOpenCaCertificatesKeyStore = new JQuickStartButton(new OpenCaCertificatesAction(kseFrame), res.getString("JQuickStartPane.jqsbOpenCaCertificatesKeyStore.text"), openCaCertificatesImage, openCaCertificatesImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbOpenCaCertificatesKeyStore.setOpaque(false);
ImageIcon examineCertificateImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbExamineCertificate.image"))));
ImageIcon examineCertificateImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbExamineCertificate.rollover.image"))));
jqsbExamineCertificate = new JQuickStartButton(new ExamineFileAction(kseFrame), res.getString("JQuickStartPane.jqsbExamineCertificate.text"), examineCertificateImage, examineCertificateImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbExamineCertificate.setOpaque(false);
ImageIcon helpImage = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbHelp.image"))));
ImageIcon helpImageRollOver = new ImageIcon(toolKit.createImage(getClass().getResource(res.getString("JQuickStartPane.jqsbHelp.rollover.image"))));
jqsbHelp = new JQuickStartButton(new HelpAction(kseFrame), res.getString("JQuickStartPane.jqsbHelp.text"), helpImage, helpImageRollOver, TEXT_COLOR, TEXT_ROLLOVER_COLOR);
jqsbHelp.setOpaque(false);
GridBagConstraints gbc_jqslHeading = new GridBagConstraints();
gbc_jqslHeading.gridheight = 1;
gbc_jqslHeading.gridwidth = 3;
gbc_jqslHeading.gridx = 0;
gbc_jqslHeading.gridy = 0;
gbc_jqslHeading.insets = new Insets(0, 0, 20, 0);
GridBagConstraints gbc_jqsbNewKeyStore = new GridBagConstraints();
gbc_jqsbNewKeyStore.gridheight = 1;
gbc_jqsbNewKeyStore.gridwidth = 1;
gbc_jqsbNewKeyStore.gridx = 0;
gbc_jqsbNewKeyStore.gridy = 1;
gbc_jqsbNewKeyStore.insets = new Insets(0, 0, 10, 10);
GridBagConstraints gbc_jqsbOpenKeyStore = new GridBagConstraints();
gbc_jqsbOpenKeyStore.gridheight = 1;
gbc_jqsbOpenKeyStore.gridwidth = 1;
gbc_jqsbOpenKeyStore.gridx = 1;
gbc_jqsbOpenKeyStore.gridy = 1;
gbc_jqsbOpenKeyStore.insets = new Insets(0, 10, 10, 10);
GridBagConstraints gbc_jqsbOpenDefaultKeyStore = new GridBagConstraints();
gbc_jqsbOpenDefaultKeyStore.gridheight = 1;
gbc_jqsbOpenDefaultKeyStore.gridwidth = 1;
gbc_jqsbOpenDefaultKeyStore.gridx = 2;
gbc_jqsbOpenDefaultKeyStore.gridy = 1;
gbc_jqsbOpenDefaultKeyStore.insets = new Insets(0, 10, 10, 10);
GridBagConstraints gbc_jqsbOpenCaCertificatesKeyStore = new GridBagConstraints();
gbc_jqsbOpenCaCertificatesKeyStore.gridheight = 1;
gbc_jqsbOpenCaCertificatesKeyStore.gridwidth = 1;
gbc_jqsbOpenCaCertificatesKeyStore.gridx = 0;
gbc_jqsbOpenCaCertificatesKeyStore.gridy = 2;
gbc_jqsbOpenCaCertificatesKeyStore.insets = new Insets(10, 0, 0, 10);
GridBagConstraints gbc_jqsbExamineCertificate = new GridBagConstraints();
gbc_jqsbExamineCertificate.gridheight = 1;
gbc_jqsbExamineCertificate.gridwidth = 1;
gbc_jqsbExamineCertificate.gridx = 1;
gbc_jqsbExamineCertificate.gridy = 2;
gbc_jqsbExamineCertificate.insets = new Insets(10, 10, 0, 10);
GridBagConstraints gbc_jqsbHelp = new GridBagConstraints();
gbc_jqsbHelp.gridheight = 1;
gbc_jqsbHelp.gridwidth = 1;
gbc_jqsbHelp.gridx = 2;
gbc_jqsbHelp.gridy = 2;
gbc_jqsbHelp.insets = new Insets(10, 10, 0, 0);
jpQuickStart = new JPanel(new GridBagLayout());
jpQuickStart.setOpaque(false);
jpQuickStart.add(jqslHeading, gbc_jqslHeading);
jpQuickStart.add(jqsbNewKeyStore, gbc_jqsbNewKeyStore);
jpQuickStart.add(jqsbOpenKeyStore, gbc_jqsbOpenKeyStore);
jpQuickStart.add(jqsbOpenDefaultKeyStore, gbc_jqsbOpenDefaultKeyStore);
jpQuickStart.add(jqsbOpenCaCertificatesKeyStore, gbc_jqsbOpenCaCertificatesKeyStore);
jpQuickStart.add(jqsbExamineCertificate, gbc_jqsbExamineCertificate);
jpQuickStart.add(jqsbHelp, gbc_jqsbHelp);
// Put in panel to prevent resize of controls and center them
// horizontally
jpNonResizeCenterHorizontally = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
jpNonResizeCenterHorizontally.setOpaque(false);
jpNonResizeCenterHorizontally.add(jpQuickStart);
// Set pane's layout to center controls vertically
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
add(Box.createVerticalGlue());
add(jpNonResizeCenterHorizontally);
}
Aggregations