Ejemplo n.º 1
0
    public Insets getBorderInsets(Component c, Insets newInsets) {
      if (MetalLookAndFeel.usingOcean()) {
        newInsets.set(1, 2, 3, 2);
      } else {
        newInsets.top = newInsets.left = newInsets.bottom = newInsets.right = 2;
      }

      if (((JToolBar) c).isFloatable()) {
        if (((JToolBar) c).getOrientation() == HORIZONTAL) {
          if (c.getComponentOrientation().isLeftToRight()) {
            newInsets.left = 16;
          } else {
            newInsets.right = 16;
          }
        } else { // vertical
          newInsets.top = 16;
        }
      }

      Insets margin = ((JToolBar) c).getMargin();

      if (margin != null) {
        newInsets.left += margin.left;
        newInsets.top += margin.top;
        newInsets.right += margin.right;
        newInsets.bottom += margin.bottom;
      }

      return newInsets;
    }
Ejemplo n.º 2
0
 @Override
 public Insets getInsets(Insets insets) {
   final NodeView nodeView = getNodeView();
   int edgeWidth = nodeView.getEdgeWidth();
   final EdgeStyle style = nodeView.getEdgeStyle();
   edgeWidth = style.getNodeLineWidth(edgeWidth);
   if (insets == null) insets = new Insets(0, 2, edgeWidth, 2);
   else insets.set(0, 2, edgeWidth, 2);
   return insets;
 }
Ejemplo n.º 3
0
 public Insets getBorderInsets(Component c, Insets newInsets) {
   if (MetalLookAndFeel.usingOcean()) {
     newInsets.set(0, 0, 2, 0);
   } else {
     newInsets.top = 1;
     newInsets.left = 0;
     newInsets.bottom = 1;
     newInsets.right = 0;
   }
   return newInsets;
 }
 /**
  * Returns an <code>Insets</code> object containing this <code>JViewport</code>s inset values. The
  * passed-in <code>Insets</code> object will be reinitialized, and all existing values within this
  * object are overwritten.
  *
  * @param insets the <code>Insets</code> object which can be reused
  * @return this viewports inset values
  * @see #getInsets
  * @beaninfo expert: true
  */
 public final Insets getInsets(Insets insets) {
   insets.set(0, 0, 0, 0);
   return insets;
 }
Ejemplo n.º 5
0
 public Insets getBorderInsets(Component c, Insets insets) {
   int[] widths = getWidths();
   insets.set(widths[TOP], widths[LEFT], widths[BOTTOM], widths[RIGHT]);
   return insets;
 }
Ejemplo n.º 6
0
 @Override
 public Insets getBorderInsets(Component component, Insets insets) {
   insets.set(0, 0, 0, 0);
   return insets;
 }
Ejemplo n.º 7
0
 public Insets getBorderInsets(Component c, Insets insets) {
   insets.set(2, 2, 2, 2);
   return insets;
 }