コード例 #1
2
ファイル: WindowsBorders.java プロジェクト: ronshapiro/j86
 /**
  * Returns a border instance for a Windows ToolBar
  *
  * @return a border used for the toolbar
  * @since 1.4
  */
 public static Border getToolBarBorder() {
   UIDefaults table = UIManager.getLookAndFeelDefaults();
   Border toolBarBorder =
       new WindowsBorders.ToolBarBorder(
           table.getColor("ToolBar.shadow"), table.getColor("ToolBar.highlight"));
   return toolBarBorder;
 }
コード例 #2
0
ファイル: WindowsBorders.java プロジェクト: ronshapiro/j86
 /**
  * Returns a border instance for a Windows Progress Bar
  *
  * @since 1.4
  */
 public static Border getProgressBarBorder() {
   UIDefaults table = UIManager.getLookAndFeelDefaults();
   Border progressBarBorder =
       new BorderUIResource.CompoundBorderUIResource(
           new WindowsBorders.ProgressBarBorder(
               table.getColor("ProgressBar.shadow"), table.getColor("ProgressBar.highlight")),
           new EmptyBorder(1, 1, 1, 1));
   return progressBarBorder;
 }
コード例 #3
0
ファイル: WindowsBorders.java プロジェクト: ronshapiro/j86
 public static Border getTableHeaderBorder() {
   UIDefaults table = UIManager.getLookAndFeelDefaults();
   Border tableHeaderBorder =
       new BorderUIResource.CompoundBorderUIResource(
           new BasicBorders.ButtonBorder(
               table.getColor("Table.shadow"),
               table.getColor("Table.darkShadow"),
               table.getColor("Table.light"),
               table.getColor("Table.highlight")),
           new BasicBorders.MarginBorder());
   return tableHeaderBorder;
 }
コード例 #4
0
ファイル: WindowsBorders.java プロジェクト: ronshapiro/j86
  public static Border getInternalFrameBorder() {
    UIDefaults table = UIManager.getLookAndFeelDefaults();
    Border internalFrameBorder =
        new BorderUIResource.CompoundBorderUIResource(
            BorderFactory.createBevelBorder(
                BevelBorder.RAISED,
                table.getColor("InternalFrame.borderColor"),
                table.getColor("InternalFrame.borderHighlight"),
                table.getColor("InternalFrame.borderDarkShadow"),
                table.getColor("InternalFrame.borderShadow")),
            new WindowsBorders.InternalFrameLineBorder(
                table.getColor("InternalFrame.activeBorderColor"),
                table.getColor("InternalFrame.inactiveBorderColor"),
                table.getInt("InternalFrame.borderWidth")));

    return internalFrameBorder;
  }
コード例 #5
0
ファイル: NimbusLookAndFeel.java プロジェクト: ronshapiro/j86
  /** {@inheritDoc} */
  @Override
  public UIDefaults getDefaults() {
    if (uiDefaults == null) {
      // Detect platform
      String osName = getSystemProperty("os.name");
      boolean isWindows = osName != null && osName.contains("Windows");

      // We need to call super for basic's properties file.
      uiDefaults = super.getDefaults();
      defaults.initializeDefaults(uiDefaults);

      // Install Keybindings
      if (isWindows) {
        WindowsKeybindings.installKeybindings(uiDefaults);
      } else {
        GTKKeybindings.installKeybindings(uiDefaults);
      }

      // Add Titled Border
      uiDefaults.put("TitledBorder.titlePosition", TitledBorder.ABOVE_TOP);
      uiDefaults.put("TitledBorder.border", new BorderUIResource(new LoweredBorder()));
      uiDefaults.put(
          "TitledBorder.titleColor", getDerivedColor("text", 0.0f, 0.0f, 0.23f, 0, true));
      uiDefaults.put(
          "TitledBorder.font", new NimbusDefaults.DerivedFont("defaultFont", 1f, true, null));

      // Choose Dialog button positions
      uiDefaults.put("OptionPane.isYesLast", !isWindows);

      // Store Table ScrollPane Corner Component
      uiDefaults.put(
          "Table.scrollPaneCornerComponent",
          new UIDefaults.ActiveValue() {
            @Override
            public Object createValue(UIDefaults table) {
              return new TableScrollPaneCorner();
            }
          });

      // Setup the settings for ToolBarSeparator which is custom
      // installed for Nimbus
      uiDefaults.put("ToolBarSeparator[Enabled].backgroundPainter", new ToolBarSeparatorPainter());

      // Populate UIDefaults with a standard set of properties
      for (String componentKey : COMPONENT_KEYS) {
        String key = componentKey + ".foreground";
        if (!uiDefaults.containsKey(key)) {
          uiDefaults.put(key, new NimbusProperty(componentKey, "textForeground"));
        }
        key = componentKey + ".background";
        if (!uiDefaults.containsKey(key)) {
          uiDefaults.put(key, new NimbusProperty(componentKey, "background"));
        }
        key = componentKey + ".font";
        if (!uiDefaults.containsKey(key)) {
          uiDefaults.put(key, new NimbusProperty(componentKey, "font"));
        }
        key = componentKey + ".disabledText";
        if (!uiDefaults.containsKey(key)) {
          uiDefaults.put(key, new NimbusProperty(componentKey, "Disabled", "textForeground"));
        }
        key = componentKey + ".disabled";
        if (!uiDefaults.containsKey(key)) {
          uiDefaults.put(key, new NimbusProperty(componentKey, "Disabled", "background"));
        }
      }

      // FileView icon keys are used by some applications, we don't have
      // a computer icon at the moment so using home icon for now
      uiDefaults.put("FileView.computerIcon", new LinkProperty("FileChooser.homeFolderIcon"));
      uiDefaults.put("FileView.directoryIcon", new LinkProperty("FileChooser.directoryIcon"));
      uiDefaults.put("FileView.fileIcon", new LinkProperty("FileChooser.fileIcon"));
      uiDefaults.put("FileView.floppyDriveIcon", new LinkProperty("FileChooser.floppyDriveIcon"));
      uiDefaults.put("FileView.hardDriveIcon", new LinkProperty("FileChooser.hardDriveIcon"));
    }
    return uiDefaults;
  }