예제 #1
0
 protected Color getGradientColor(boolean active) {
   Color color =
       active
           ? painterResource.getColor(GRADIENT_COLOR_ACTIVE)
           : painterResource.getColor(GRADIENT_COLOR);
   return color == null ? SwingUtility.darker(getBackgroundColor(active), 0.75) : color;
 }
예제 #2
0
 public void mouseDragged(MouseEvent e) {
   if (enabled) {
     Point loc = e.getPoint();
     SwingUtilities.convertPointToScreen(loc, (Component) e.getSource());
     SwingUtility.subtract(loc, dragOffset);
     frame.setLocation(loc);
   }
 }
예제 #3
0
  public static void main(String[] args) {
    try {
      final AllDemos a = new AllDemos();
      a.setDefaultCloseOperation(AllDemos.EXIT_ON_CLOSE);
      DemoUtility.setDemoDisableExitOnClose();
      SwingUtility.centerOnScreen(a);
      a.setVisible(true);

      for (int i = 0; i < args.length; i++) {
        final String full_class_name = args[i];
        SwingUtilities.invokeLater(
            new Runnable() {
              public void run() {
                a.launchClass(full_class_name);
              }
            });
      }
    } catch (Throwable t) {
      t.printStackTrace();
      System.exit(-1);
    }
  }