protected void adjustComponent(JComponent comp) {
   // comp.putClientProperty("Quaqua.Component.visualMargin", new Insets(0,0,0,0));
   Font font = UIManager.getFont("SmallSystemFont");
   if (font != null) {
     comp.setFont(font);
   }
   comp.putClientProperty("JComponent.sizeVariant", "small");
   if (comp instanceof JButton) {
     comp.putClientProperty("JButton.buttonType", "roundRect");
   }
   if (comp instanceof JComboBox) {
     // comp.putClientProperty("JComboBox.isSquare", Boolean.TRUE);
   }
 }
  /** {@inheritDoc} */
  @Override
  protected void uninstallDefaults() {
    SynthContext context = getContext(getComponent(), ENABLED);
    JComponent c = getComponent();
    c.putClientProperty("caretAspectRatio", null);

    style.uninstallDefaults(context);
    context.dispose();
    style = null;

    Object clientProperty = c.getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES);
    if (clientProperty == localTrue) {
      c.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.FALSE);
    }
    super.uninstallDefaults();
  }
 protected void installDefaults() {
   // Installs the text cursor on the component
   super.installDefaults();
   JComponent c = getComponent();
   Object clientProperty = c.getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES);
   if (clientProperty == null || clientProperty == localFalse) {
     c.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, localTrue);
   }
   updateStyle((JTextComponent) getComponent());
 }
  // installs a private instance of GestureHandler, if necessary
  static void addGestureListenerTo(final JComponent component, final GestureListener listener) {
    final Object value = component.getClientProperty(CLIENT_PROPERTY);
    if (value instanceof GestureHandler) {
      ((GestureHandler) value).addListener(listener);
      return;
    }

    if (value != null) return; // some other garbage is in our client property

    final GestureHandler newHandler = new GestureHandler();
    newHandler.addListener(listener);
    component.putClientProperty(CLIENT_PROPERTY, newHandler);
  }
  public void assertIsDispatchThread(@Nullable final JComponent component) {
    if (component == null) return;

    Thread curThread = Thread.currentThread();
    if (ourDispatchThread == curThread) {
      return;
    }

    if (Boolean.TRUE.equals(component.getClientProperty(WAS_EVER_SHOWN))) {
      assertIsDispatchThread();
    } else {
      final JRootPane root = component.getRootPane();
      if (root != null) {
        component.putClientProperty(WAS_EVER_SHOWN, Boolean.TRUE);
        assertIsDispatchThread();
      }
    }
  }
 private synchronized void putState(JComponent component, Part part, State state) {
   component.putClientProperty(PartUIClientPropertyKey.getKey(part), state);
 }
 public static void suppressMacCornerFor(JComponent popupComponent) {
   popupComponent.putClientProperty(SUPPRESS_MAC_CORNER, Boolean.TRUE);
 }
Beispiel #8
0
 public void setFillColumn(JComponent c, boolean b) {
   c.putClientProperty("VariableGridLayout.fillColumn", b);
 }