Java 8 InsetsUIResource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InsetsUIResource class.

This code example shows how to use the following methods:
    if ("null".equals(value)) {
      return null; 
    } 
    if (key.endsWith("Insets")) {
      final List<String> numbers = StringUtil.split(value, ",");
      return new InsetsUIResource(Integer.parseInt(numbers.get(0)),
          Integer.parseInt(numbers.get(1)),
          Integer.parseInt(numbers.get(2)),
          Integer.parseInt(numbers.get(3)));
    } else if (key.endsWith(".border")) {
      try { 
        return Class.forName(value).newInstance();
      } catch (Exception e) {log(e);}
    } else { 
      final Color color = ColorUtil.fromHex(value, null);
      final Integer invVal = getInteger(value);
      final Boolean boolVal = "true".equals(value) ? Boolean.TRUE : "false".equals(value) ? Boolean.FALSE : null;
      Icon icon = key.toLowerCase().endsWith("icon") ? null : null; //TODO: copy image loading
      if (color != null) { 
        return  new ColorUIResource(color);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  } 
 
  @Override 
  public Insets getBorderInsets(Component c) {
    if (DarculaButtonUI.isSquare(c)) {
      return new InsetsUIResource(2, 0, 2, 0);
    } 
    return new InsetsUIResource(8, 16, 8, 14);
  } 
 
  protected int getOffset() { 
    return myOffset;
  } 
 
  @Override 
  public boolean isBorderOpaque() { 
    return false; 
  } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
      g.drawRect(x, y, w-1, h-1);
    } 
 
    @Override 
    public Insets getBorderInsets(Component c) {
        return new InsetsUIResource(1, 1, 1, 1);
    } 
 
    @Override 
    public boolean isBorderOpaque() { 
        return true; 
    } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                getButtonMargin(2, 3),            // button margin 
                getButtonMargin(2, 3),            // commit button margin 
                WINDOWS_CHECK_BOX_MARGIN,         // check box margin
                new InsetsUIResource(3, 0, 3, 0), // menu item margin
                new InsetsUIResource(2, 3, 2, 4), // menu margin
                new InsetsUIResource(2, 3, 3, 3)  // popup menu separator margin
                ); 
    } 
 
 
    public static MicroLayout createWindowsXPHiResMicroLayout() { 
        return new MicroLayout( 
                new InsetsUIResource(2, 2, 3, 2), // text insets
                new InsetsUIResource(2, 2, 3, 2), // wrapped text insets
                new InsetsUIResource(2, 2, 3, 2), // combo box editor insets
                1,                                // combo border size 
                1,                                // combo popup border size 
                new Insets(3, 2, 4, 2),           // button border insets
                getButtonMargin(2, 3),            // button margin 
                getButtonMargin(2, 3),            // commit button margin 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		if (margin == null || margin instanceof UIResource) {
			margin = (Insets) style.get(ctx, prefix + ".margin");
 
			if (margin == null) {
				// Some places assume margins are non-null. 
				margin = new InsetsUIResource(0, 0, 0, 0);//SynthLookAndFeel.EMPTY_UIRESOURCE_INSETS;
			} 
			comp.setMargin(margin);
		} 
 
		Caret caret = comp.getCaret();
		if (caret instanceof UIResource) {
			Object o = style.get(ctx, prefix + ".caretBlinkRate");
			if (o != null && o instanceof Integer) {
				Integer rate = (Integer) o;
				caret.setBlinkRate(rate.intValue());
			} 
		} 
	} 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  } 
 
  protected Object parseValue(String key, @NotNull String value) {
    if (key.endsWith("Insets")) {
      final List<String> numbers = StringUtil.split(value, ",");
      return new InsetsUIResource(Integer.parseInt(numbers.get(0)),
                                  Integer.parseInt(numbers.get(1)),
                                  Integer.parseInt(numbers.get(2)),
                                  Integer.parseInt(numbers.get(3)));
    } else if (key.endsWith(".border")) {
      try { 
        return Class.forName(value).newInstance();
      } catch (Exception e) {log(e);}
    } else { 
      final Color color = parseColor(value);
      final Integer invVal = getInteger(value);
      final Boolean boolVal = "true".equals(value) ? Boolean.TRUE : "false".equals(value) ? Boolean.FALSE : null;
      Icon icon = value.startsWith("AllIcons.") ? IconLoader.getIcon(value) : null;
      if (icon == null && value.endsWith(".png")) {
        icon = IconLoader.findIcon(value, getClass(), true);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    g.drawRect(0,0,width-1,height-1);
  } 
 
  @Override 
  public Insets getBorderInsets(Component c) {
    return new InsetsUIResource(1,1,1,1);
  } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    config.restore();
  } 
 
  @Override 
  public Insets getBorderInsets(Component c) {
    return new InsetsUIResource(5, 7, 5, 7);
  } 
 
  @Override 
  public boolean isBorderOpaque() { 
    return true; 
  } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  } 
 
  @Override 
  public Insets getBorderInsets(Component c) {
    if (DarculaButtonUI.isSquare(c)) {
      return new InsetsUIResource(2, 0, 2, 0);
    } 
    return new InsetsUIResource(8, 16, 8, 14);
  } 
 
 
  @Override 
  public boolean isBorderOpaque() { 
    return false; 
  } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  } 
 
  protected Object parseValue(String key, @NotNull String value) {
    if (key.endsWith("Insets")) {
      final List<String> numbers = StringUtil.split(value, ",");
      return new InsetsUIResource(Integer.parseInt(numbers.get(0)),
                                  Integer.parseInt(numbers.get(1)),
                                  Integer.parseInt(numbers.get(2)),
                                  Integer.parseInt(numbers.get(3)));
    } else if (key.endsWith(".border")) {
      try { 
        return Class.forName(value).newInstance();
      } catch (Exception e) {log(e);}
    } else { 
      final Color color = parseColor(value);
      final Integer invVal = getInteger(value);
      final Boolean boolVal = "true".equals(value) ? Boolean.TRUE : "false".equals(value) ? Boolean.FALSE : null;
      Icon icon = value.startsWith("AllIcons.") ? IconLoader.getIcon(value) : null;
      if (icon == null && value.endsWith(".png")) {
        icon = IconLoader.findIcon(value, getClass(), true);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 InsetsUIResource Methods: