Exemplo n.º 1
1
  /**
   * Overridden to message super and forward the method to the tree. Since the tree is not actually
   * in the component hierarchy it will never receive this unless we forward it in this manner.
   */
  public void updateUI() {
    super.updateUI();

    if (tree != null) tree.updateUI();

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
  }
Exemplo n.º 2
0
 protected void installDefaults() {
   LookAndFeel.installColorsAndFont(
       optionPane, "OptionPane.background", "OptionPane.foreground", "OptionPane.font");
   LookAndFeel.installBorder(optionPane, "OptionPane.border");
   minimumSize = UIManager.getDimension("OptionPane.minimumSize");
   LookAndFeel.installProperty(optionPane, "opaque", Boolean.TRUE);
 }
Exemplo n.º 3
0
  protected void installDefaults(final JComponent c) {
    LookAndFeel.installColorsAndFont(c, "ToolTip.background", "ToolTip.foreground", "ToolTip.font");
    LookAndFeel.installBorder(c, "ToolTip.border");

    backgroundInactiveColor = UIManager.getColor("ToolTip.backgroundInactive");
    foregroundInactiveColor = UIManager.getColor("ToolTip.foregroundInactive");
  }
Exemplo n.º 4
0
  protected void installDefaults(AbstractButton b) {
    // load shared instance defaults
    String pp = getPropertyPrefix();

    defaultTextShiftOffset = UIManager.getInt(pp + "textShiftOffset");

    // set the following defaults on the button
    if (b.isContentAreaFilled()) {
      LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
    } else {
      LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
    }

    if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
      b.setMargin(UIManager.getInsets(pp + "margin"));
    }

    LookAndFeel.installColorsAndFont(b, pp + "background", pp + "foreground", pp + "font");
    LookAndFeel.installBorder(b, pp + "border");

    Object rollover = UIManager.get(pp + "rollover");
    if (rollover != null) {
      LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
    }

    LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
  }
Exemplo n.º 5
0
 public AnimatedToolTip(JLabel label) {
   super();
   this.iconlabel = label;
   LookAndFeel.installColorsAndFont(
       iconlabel, "ToolTip.background", "ToolTip.foreground", "ToolTip.font");
   iconlabel.setOpaque(true);
   setLayout(new BorderLayout());
   add(iconlabel);
 }
 protected void installDefaults() {
   LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);
   LookAndFeel.installBorder(progressBar, "ProgressBar.border");
   LookAndFeel.installColorsAndFont(
       progressBar, "ProgressBar.background", "ProgressBar.foreground", "ProgressBar.font");
   cellLength = UIManager.getInt("ProgressBar.cellLength");
   if (cellLength == 0) cellLength = 1;
   cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");
   selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
   selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
 }
Exemplo n.º 7
0
  /** This method installs the defaults as specified by the look and feel. */
  protected void installDefaults() {
    LookAndFeel.installBorder(toolBar, "ToolBar.border");
    LookAndFeel.installColorsAndFont(
        toolBar, "ToolBar.background", "ToolBar.foreground", "ToolBar.font");

    dockingBorderColor = UIManager.getColor("ToolBar.dockingForeground");
    dockingColor = UIManager.getColor("ToolBar.dockingBackground");

    floatingBorderColor = UIManager.getColor("ToolBar.floatingForeground");
    floatingColor = UIManager.getColor("ToolBar.floatingBackground");
  }
 public void installUI(JComponent jComponent) {
   grid = (JGrid) jComponent;
   rendererPane = new CellRendererPane();
   grid.add(rendererPane);
   gridHeader = (JGrid) jComponent;
   jComponent.setOpaque(false);
   LookAndFeel.installColorsAndFont(
       jComponent, "TableHeader.background", "TableHeader.foreground", "TableHeader.font");
   installDefaults();
   installListeners();
   installKeyboardActions();
 }
  protected void installDefaults() {
    // Note: Omitting the following line was a bug from v1.3.01 until v1.3.04
    // Note: The following method turned out to be new in 1.5. Therefore
    // replaced with progressBar.setOpaque(true)
    // LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);

    // removed again in 1.3.7 (because opaque progress bar
    // fills bounds with track [background] color)
    // progressBar.setOpaque(true);

    LookAndFeel.installBorder(progressBar, "ProgressBar.border");
    LookAndFeel.installColorsAndFont(
        progressBar, "ProgressBar.background", "ProgressBar.foreground", "ProgressBar.font");
  }
Exemplo n.º 10
0
  /**
   * Tells the look and feel to reset some of the values for this component so that it doesn't use
   * JTextArea's default values.
   *
   * <p>DO NOT CALL THIS METHOD YOURSELF!
   */
  public void updateUI() {
    super.updateUI();
    // setLineWrap(true);
    setWrapStyleWord(true);
    setHighlighter(null);
    setEditable(false);
    LookAndFeel.installBorder(this, "Label.border");
    LookAndFeel.installColorsAndFont(this, "Label.background", "Label.foreground", "Label.font");
    if (resizeHandler != null) {
      resizeHandler.componentResized(null);
    }

    // update restricted size
    SizePolicy policy = (SizePolicy) getClientProperty(SizePolicy.class);
    if (policy != null) {
      GUIUtils.restrictSize(this, policy);
    }
  }
Exemplo n.º 11
0
 protected void installDefaults(JPanel p) {
   LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font");
   LookAndFeel.installBorder(p, "Panel.border");
   LookAndFeel.installProperty(p, "opaque", Boolean.TRUE);
 }
  private void initializeGUI() {

    this.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    ColumnModel m = new ColumnModel(this.controller);

    TableModel headerData = new RowModel(this.controller);
    AbstractTableModel data = new StageTableModel(this.controller, m);
    JTable table = new JTable(data);
    table.setColumnModel(m);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    JTable rowHeader = new JTable(headerData);
    rowHeader.setColumnModel(new EmptyColumns());

    LookAndFeel.installColorsAndFont(
        rowHeader, "TableHeader.background", "TableHeader.foreground", "TableHeader.font");

    rowHeader.setIntercellSpacing(new Dimension(0, 0));
    Dimension d = rowHeader.getPreferredScrollableViewportSize();
    d.width = rowHeader.getPreferredSize().width;
    rowHeader.setPreferredScrollableViewportSize(d);
    rowHeader.setRowHeight(table.getRowHeight());
    rowHeader.setDefaultRenderer(Object.class, new RowHeaderRenderer());

    JScrollPane scrollPane = new JScrollPane(table);

    scrollPane.setRowHeaderView(rowHeader);

    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

    JTableHeader corner = rowHeader.getTableHeader();
    corner.setResizingAllowed(false);
    corner.setReorderingAllowed(false);

    scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, corner);

    new JScrollPaneAdjuster(scrollPane);

    new JTableRowHeaderResizer(scrollPane).setEnabled(true);

    new RowHeaderResizer(scrollPane).setEnabled(true);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.gridwidth = 9;
    c.gridx = 0;
    c.gridy = 0;
    this.add(scrollPane, c);
    JPanel button_panel = new JPanel(new GridLayout());
    button_panel.setPreferredSize(new Dimension(250, 50));
    AddStageButtonListener list = new AddStageButtonListener(this);
    JButton add_stage = new JButton("Add");
    add_stage.setPreferredSize(new Dimension(75, 30));
    add_stage.addActionListener(list);
    JButton rename_stage = new JButton("Rename");
    rename_stage.setPreferredSize(new Dimension(100, 30));
    rename_stage.addActionListener(new RenameStageButtonListener(this));
    JButton delete_stage = new JButton("Delete");
    delete_stage.setPreferredSize(new Dimension(75, 30));
    delete_stage.addActionListener(new DeleteStageButtonListener(this));
    button_panel.add(add_stage);
    button_panel.add(rename_stage);
    button_panel.add(delete_stage);
    c.weightx = 0;
    c.gridwidth = 3;
    c.gridy = 1;
    c.gridx = 3;
    this.add(button_panel, c);
  }
Exemplo n.º 13
0
 /** Update the font. */
 public void updateFont() {
   LookAndFeel.installColorsAndFont(
       tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font");
 }