Exemple #1
0
 private JRadioButton getRegionButton(
     JRadioButton button, int x, int y, int w, int h, String tip) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alRegion);
   regionButtons.add(button);
   return button;
 }
Exemple #2
0
 private JRadioButton getShapeButton(
     JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alShape);
   shapeButtons.add(button);
   shapes.put(shp, button);
   objects.put(shp, obj);
   return button;
 }
  private void updateBorder() {
    // Preserve old borders
    if (SwingUtils.isPreserveBorders(radioButton)) {
      return;
    }

    // Actual margin
    final boolean ltr = radioButton.getComponentOrientation().isLeftToRight();
    final Insets m =
        new Insets(
            margin.top,
            ltr ? margin.left : margin.right,
            margin.bottom,
            ltr ? margin.right : margin.left);

    // Installing border
    radioButton.setBorder(LafUtils.createWebBorder(m));
  }