public HDMColdAccountForm(final WalletListPanel walletListPanel) {
    this.walletListPanel = walletListPanel;

    inactiveBackGroundColor = Color.WHITE;
    selected = false;
    panelMain.setOpaque(true);
    panelMain.setFocusable(true);
    panelMain.setBackground(inactiveBackGroundColor);

    if (ColorAndFontConstants.isInverse()) {
      inactiveBackGroundColor =
          new Color(
              Math.min(255, Themes.currentTheme.detailPanelBackground().getRed() + 2 * COLOR_DELTA),
              Math.min(
                  255, Themes.currentTheme.detailPanelBackground().getBlue() + 2 * COLOR_DELTA),
              Math.min(
                  255, Themes.currentTheme.detailPanelBackground().getGreen() + 2 * COLOR_DELTA));
    } else {
      inactiveBackGroundColor =
          new Color(
              Math.max(0, Themes.currentTheme.detailPanelBackground().getRed() - COLOR_DELTA),
              Math.max(0, Themes.currentTheme.detailPanelBackground().getBlue() - COLOR_DELTA),
              Math.max(0, Themes.currentTheme.detailPanelBackground().getGreen() - COLOR_DELTA));
    }
    panelMain.applyComponentOrientation(
        ComponentOrientation.getOrientation(LocaliserUtils.getLocale()));

    updateFromModel();
    panelMain.addMouseListener(
        new WalletMouseListener(this.walletListPanel, HDMColdAccountForm.this));

    setSelected(false);
    setContent();
  }
示例#2
1
  public BrowserFrame(Browser b) {
    super("Cavity Nesting DB Browser");
    browser = b;

    JPanel content = new JPanel(new BorderLayout());
    content.setOpaque(true);
    setContentPane(content);

    content.add(browser, BorderLayout.CENTER);

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    addWindowListener(
        new WindowAdapter() {
          public void windowClosed(WindowEvent e) {
            browser.closeBrowser();
          }
        });

    createJMenuBar();
    setJMenuBar(menubar);

    setVisible(true);
    pack();
  }
示例#3
0
  public FileNameRenderer(JTable table) {
    Border b = UIManager.getBorder("Table.noFocusBorder");
    if (Objects.isNull(b)) { // Nimbus???
      Insets i = focusCellHighlightBorder.getBorderInsets(textLabel);
      b = BorderFactory.createEmptyBorder(i.top, i.left, i.bottom, i.right);
    }
    noFocusBorder = b;

    p.setOpaque(false);
    panel.setOpaque(false);

    // http://www.icongalore.com/ XP Style Icons - Windows Application Icon, Software XP Icons
    nicon = new ImageIcon(getClass().getResource("wi0063-16.png"));
    sicon =
        new ImageIcon(
            p.createImage(
                new FilteredImageSource(nicon.getImage().getSource(), new SelectedImageFilter())));

    iconLabel = new JLabel(nicon);
    iconLabel.setBorder(BorderFactory.createEmptyBorder());

    p.add(iconLabel, BorderLayout.WEST);
    p.add(textLabel);
    panel.add(p, BorderLayout.WEST);

    Dimension d = iconLabel.getPreferredSize();
    dim.setSize(d);
    table.setRowHeight(d.height);
  }
示例#4
0
  /** Description of the Method */
  public void init() {
    // super.init();
    size = new Dimension(570, 570);
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);

    Dimension d = messagePanel.getSize();
    d.height += 20;
    messagePanel.setPreferredSize(d);
    contentPane.add(messagePanel, BorderLayout.SOUTH);

    contentPane.setOpaque(true);
    userPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(2, 2, 2, 2);

    messagePanel.setLayout(borderLayout5);
    contentPane.setOpaque(true);
    contentPane.setBackground(Color.white);
    this.setSize(size);

    messagePanel.add(labelMessage, BorderLayout.NORTH);
    // Logg.logg("MhClient: Före XttTree-skapande", 6);
    this.mhTable = new MhTable(root, false, this.labelMessage);
    // Logg.logg("MhClient: mhTable-skapande klart", 6);
    this.contentPane.add(this.mhTable.splitPane, BorderLayout.CENTER);
  }
  /** Funkcja inicjalizująca komponenty */
  private void initializeComponent() {
    setSize(FrameSize.getWidth(), FrameSize.getHeight());
    setLayout(new BorderLayout());

    bgComponent = new BackgroundComponent("loginBG.jpg");
    bgComponent.setLayout(new BorderLayout());

    JPanel containerPanel = new JPanel();
    containerPanel.setOpaque(false);
    containerPanel.setLayout(new GridLayout(2, 2));
    JLabel name = new JLabel("Nazwa użytkownika:");
    name.setForeground(Color.WHITE);
    containerPanel.add(name);
    username = new JTextField(defaultOptions.getDefaultUsername());
    containerPanel.add(username);

    JLabel passwdLabel = new JLabel("wprowadż hasło:");
    passwdLabel.setForeground(Color.WHITE);
    containerPanel.add(passwdLabel);
    password = new JPasswordField("");
    containerPanel.add(password);

    bgComponent.add(containerPanel, BorderLayout.NORTH);

    okButton = new JButton("zatwierdź");
    okButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent event) {
            if (!user.isLoggedIn()) {

              LoginController loginController = new LoginController();
              if (loginController.logIn(username.getText(), password.getPassword().toString())) {
                parent.hideLoginPanel();
                parent.showCreateTaskJPanel();
              }
            }
          }
        });

    guestSessionButton = new JButton("policz jako gość");
    guestSessionButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent event) {
            parent.hideLoginPanel();
            parent.showCreateTaskJPanel();
          }
        });

    JPanel buttonContainerPanel = new JPanel();
    buttonContainerPanel.setOpaque(false);
    buttonContainerPanel.add(okButton);
    buttonContainerPanel.add(guestSessionButton);
    bgComponent.add(buttonContainerPanel, BorderLayout.SOUTH);
    add(bgComponent);
  }
示例#6
0
  public void buildCenter() {
    pCenter1.setOpaque(false);
    pCenter2.setOpaque(false);

    add("Center", pCenter1);
    pCenter1.add(title);
    pCenter1.add(pCenter2);
    pCenter2.add(weight);
    pCenter2.add(weight1);
    pCenter2.add(newWeight);
    pCenter2.add(weight2);
  }
示例#7
0
  private void populateShop() {
    final String constraints1 = "w 60px, h 26px!";
    final String constraints2 = "w 150px!, h 26px!";

    pnlShop.setOpaque(false);
    pnlShop.setLayout(new MigLayout("insets 0, gap 0, wrap 2, hidemode 3"));
    pnlShop.removeAll();
    pnlShop.add(lblErrShop, "w 100%!, h 30px!, span 2 1");

    pnlShop.add(new FLabel.Builder().text("Maximum Packs").build(), constraints2);
    pnlShop.add(new PrefInput(QPref.SHOP_MAX_PACKS, QuestPreferencesErrType.SHOP), constraints1);

    pnlShop.add(new FLabel.Builder().text("Starting Packs").build(), constraints2);
    pnlShop.add(
        new PrefInput(QPref.SHOP_STARTING_PACKS, QuestPreferencesErrType.SHOP), constraints1);

    pnlShop.add(new FLabel.Builder().text("Wins for Pack").build(), constraints2);
    pnlShop.add(
        new PrefInput(QPref.SHOP_WINS_FOR_ADDITIONAL_PACK, QuestPreferencesErrType.SHOP),
        constraints1);

    pnlShop.add(new FLabel.Builder().text("Wins per Set Unlock").build(), constraints2);
    pnlShop.add(new PrefInput(QPref.WINS_UNLOCK_SET, QuestPreferencesErrType.SHOP), constraints1);

    pnlShop.add(new FLabel.Builder().text("Common Singles").build(), constraints2);
    pnlShop.add(
        new PrefInput(QPref.SHOP_SINGLES_COMMON, QuestPreferencesErrType.SHOP), constraints1);

    pnlShop.add(new FLabel.Builder().text("Uncommon Singles").build(), constraints2);
    pnlShop.add(
        new PrefInput(QPref.SHOP_SINGLES_UNCOMMON, QuestPreferencesErrType.SHOP), constraints1);

    pnlShop.add(new FLabel.Builder().text("Rare Singles").build(), constraints2);
    pnlShop.add(new PrefInput(QPref.SHOP_SINGLES_RARE, QuestPreferencesErrType.SHOP), constraints1);
  }
 /**
  * Renvoit le JPanel à afficher, avec en paramètre un booléen indiquant s'il s'agit du dernier
  * élément à afficher dans une liste d'enfants (auquel cas un bouton + peut être affiché)
  */
 private JPanel getPanel(final boolean dernier) {
   panelEnfants = new JPanel(new GridBagLayout());
   panelElement = new JPanel(new BorderLayout());
   if (!attribut && affParent != null && affParent.enfantsMultiples(refNoeud)) {
     final JPanel panelBoutons = new JPanel(new BorderLayout());
     if (dernier) {
       final JButton boutonPlus = new JButton("+");
       boutonPlus.setAction(
           new AbstractAction("+") {
             public void actionPerformed(final ActionEvent e) {
               affParent.ajouterAffichageEnfant(AffichageFormulaire.this);
             }
           });
       panelBoutons.add(boutonPlus, BorderLayout.WEST);
     }
     final JButton boutonMoins = new JButton("-");
     boutonMoins.setAction(
         new AbstractAction("-") {
           public void actionPerformed(final ActionEvent e) {
             affParent.retirerAffichageEnfant(AffichageFormulaire.this);
           }
         });
     panelBoutons.add(boutonMoins, BorderLayout.EAST);
     panelElement.add(panelBoutons, BorderLayout.EAST);
     panelElement.add(panelEnfants, BorderLayout.CENTER);
   } else panelElement.add(panelEnfants, BorderLayout.CENTER);
   if (affParent != null) {
     panelElement.add(getPanelTitre(), BorderLayout.NORTH);
     panelEnfants.setBorder(
         BorderFactory.createCompoundBorder(
             BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 5, 5, 5)));
     panelElement.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
   }
   majPanel(null);
   if (affParent == null) {
     panelEnfants.setFocusCycleRoot(true);
     panelElement =
         new JPanel(new BorderLayout()) {
           @Override
           public Dimension getMaximumSize() {
             if (System.getProperty("os.name")
                 .startsWith("Mac OS")) { // curseur pas visible à droite sur la JVM d'Apple avec
               // getMaximumSize()
               final Dimension tps = doc.textPane.getSize();
               final JaxeElement je = doc.getElementForNode(noeud);
               return (new Dimension(tps.width - 20 * (je.indentations() + 1) - 2, tps.height));
             }
             return (super.getMaximumSize());
           }
         };
     panelElement.setOpaque(false);
     panelElement.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
     panelEnfants.setBorder(
         BorderFactory.createCompoundBorder(
             BorderFactory.createTitledBorder(getTitre()),
             BorderFactory.createEmptyBorder(5, 5, 5, 5)));
     panelElement.add(panelEnfants, BorderLayout.CENTER);
   }
   return (panelElement);
 }
示例#9
0
 /**
  * Called by the constructor methods to create the default <code>glassPane</code>. By default this
  * method creates a new <code>JComponent</code> with visibility set to false.
  *
  * @return the default <code>glassPane</code>
  */
 protected Component createGlassPane() {
   JComponent c = new JPanel();
   c.setName(this.getName() + ".glassPane");
   c.setVisible(false);
   ((JPanel) c).setOpaque(false);
   return c;
 }
  private void createProgressPanel() {
    myProgressIcon = new AsyncProcessIcon("Designer progress");
    myProgressMessage = new JLabel();

    JPanel progressBlock = new JPanel();
    progressBlock.add(myProgressIcon);
    progressBlock.add(myProgressMessage);
    progressBlock.setBorder(IdeBorderFactory.createRoundedBorder());

    myProgressPanel = new JPanel(new GridBagLayout());
    myProgressPanel.add(
        progressBlock,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0,
            0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    myProgressPanel.setOpaque(false);
  }
  @Override
  protected void addComponents() {
    // add descriptive panel
    JPanel metaDataPanel = new JPanel();
    metaDataPanel.setOpaque(false);
    metaDataPanel.setLayout(new FlowLayout(FlowLayout.LEFT));

    // table label
    JLabel tableLabel = new JLabel("<html><b>" + PSM_TABLE_DESC + "</b></html>");
    metaDataPanel.add(tableLabel);
    this.add(metaDataPanel, BorderLayout.NORTH);

    psmTable =
        TableFactory.createPSMTable(
            controller.getAvailablePeptideLevelScores(),
            PeptideRankingFilter.LESS_EQUAL_THAN_ONE.getRankingThreshold(),
            controller);

    // add PSM table selection listener
    psmTable.getSelectionModel().addListSelectionListener(new PSMSelectionListener(psmTable));

    JScrollPane scrollPane =
        new JScrollPane(
            psmTable,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.add(scrollPane, BorderLayout.CENTER);
  }
示例#12
0
 public void changePanel() {
   card.next(mainPanel);
   buttonPanel.removeAll();
   ctl.setText("- Play -");
   buttonPanel.add(ctl);
   buttonPanel.add(rank);
   buttonPanel.add(exit);
   buttonPanel.setOpaque(false);
   buttonPanel.setBounds(width / 2 - 50, height / 2 - 50, 80, 100);
   count++;
   memory[count] = new Memory();
   menuPanel.setMemory(memory[count]);
   secondPanel.setMemory(memory[count]);
   gamePanel.setMemory(memory[count]);
   rankPanel.setMemory(memory, count);
   check = 0;
   System.out.println(
       count
           + " "
           + memory[count - 1].name
           + " "
           + memory[count - 1].song
           + " "
           + memory[count - 1].score);
 }
示例#13
0
  // Create small Pits in board
  private JPanel centerBoardPanel() {
    JPanel centerPanel = new JPanel(new GridLayout(2, 6, 20, 100));
    centerPanel.setOpaque(false);

    /*Initialize/Create buttons Array */
    buttons = new JButton[SMALL_PIT_COUNT];

    for (int i = 0; i < SMALL_PIT_COUNT; i++) {
      if (i < SMALL_PIT_COUNT / 2) {
        JButton b = new JButton(String.valueOf(game.board.getPitAt(i).getCount()));
        b.setFont(new Font("Belta Regular", Font.BOLD, 32));
        b.addActionListener(new ButtonListener());
        buttons[i] = b;
      } else {
        JButton b = new JButton(String.valueOf(game.board.getPitAt(i + 1).getCount()));
        b.setFont(new Font("Belta Regular", Font.BOLD, 32));
        b.addActionListener(new ButtonListener());
        buttons[i] = b;
      }
    }

    for (int i = SMALL_PIT_COUNT - 1; i >= 6; i--) {
      buttons[i].setBackground(new Color(214, 162, 173));
      centerPanel.add(buttons[i]);
    }

    for (int j = 0; j < SMALL_PIT_COUNT / 2; j++) {
      buttons[j].setBackground(new Color(214, 162, 173));
      centerPanel.add(buttons[j]);
    }

    return centerPanel;
  }
  /** Initialize the panel containing the node. */
  public PluginListCellRenderer() {
    super(new BorderLayout(8, 8));

    JPanel mainPanel = new JPanel(new BorderLayout());

    this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    this.setBackground(Color.WHITE);

    this.setOpaque(true);

    mainPanel.setOpaque(false);
    this.nameVersionPanel.setOpaque(false);

    this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    this.nameLabel.setIconTextGap(2);

    this.nameLabel.setFont(this.getFont().deriveFont(Font.BOLD));
    this.systemLabel.setFont(this.getFont().deriveFont(Font.BOLD));

    this.nameVersionPanel.add(nameLabel);
    this.nameVersionPanel.add(versionLabel);

    mainPanel.add(nameVersionPanel, BorderLayout.NORTH);
    mainPanel.add(descriptionLabel, BorderLayout.CENTER);

    this.add(iconLabel, BorderLayout.WEST);

    this.add(mainPanel, BorderLayout.CENTER);
    this.add(stateLabel, BorderLayout.WEST);
  }
示例#15
0
 public void setBattleFieldBackground(String background) {
   ((JPanel) c).setOpaque(false);
   ImageIcon imgi = new ImageIcon(background);
   JLabel img_label = new JLabel(imgi);
   this.getLayeredPane().add(img_label, new Integer(Integer.MIN_VALUE + 1));
   img_label.setBounds(posX, posY, Constant.BATTLEFIELD_WIDTH, Constant.BATTLEFIELD_HEIGHT);
 }
示例#16
0
 public void setBackground(String background) {
   ((JPanel) c).setOpaque(false);
   ImageIcon imgi = new ImageIcon(background);
   JLabel img_label = new JLabel(imgi);
   this.getLayeredPane().add(img_label, new Integer(Integer.MIN_VALUE));
   img_label.setBounds(0, 0, width, height);
 }
 private static JComponent wrap(@NotNull JComponent content, @NotNull String title) {
   JPanel result = new JPanel(new BorderLayout());
   result.setOpaque(false);
   result.setBorder(IdeBorderFactory.createTitledBorder(title, false));
   result.add(content, BorderLayout.CENTER);
   return result;
 }
示例#18
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == ctl) {
     this.menu();
   } else if (e.getSource() == exit) {
     exitPerform();
   } else if (e.getSource() == rank) {
     if (count != 0) {
       card.show(mainPanel, "four");
       rankPanel.setMemory(memory, count - 1);
       buttonPanel.removeAll();
       buttonPanel.setBounds(width - 200, height - 80, 190, 50);
       buttonPanel.add(exit);
       check = 4;
       count--;
     }
   } else if (e.getSource() == back) {
     if (secondPanel.clip != null) {
       secondPanel.clip.stop();
       System.out.printf("test");
     }
     check = 0;
     card.previous(mainPanel);
     buttonPanel.removeAll();
     ctl.setText("- Play -");
     buttonPanel.add(ctl);
     buttonPanel.add(rank);
     buttonPanel.add(exit);
     buttonPanel.setOpaque(false);
     buttonPanel.setBounds(width / 2 - 50, height / 2 - 50, 80, 100);
   }
 }
  private JPanel readSplitter(
      JPanel panel, Element splitterElement, Ref<EditorWindow> currentWindow) {
    final boolean orientation =
        "vertical".equals(splitterElement.getAttributeValue("split-orientation"));
    final float proportion =
        Float.valueOf(splitterElement.getAttributeValue("split-proportion")).floatValue();
    final Element first = splitterElement.getChild("split-first");
    final Element second = splitterElement.getChild("split-second");

    Splitter splitter;
    if (panel == null) {
      panel = new JPanel(new BorderLayout());
      panel.setOpaque(false);
      splitter = new Splitter(orientation, proportion, 0.1f, 0.9f);
      panel.add(splitter, BorderLayout.CENTER);
      splitter.setFirstComponent(readExternalPanel(first, null, currentWindow));
      splitter.setSecondComponent(readExternalPanel(second, null, currentWindow));
    } else if (panel.getComponent(0) instanceof Splitter) {
      splitter = (Splitter) panel.getComponent(0);
      readExternalPanel(first, (JPanel) splitter.getFirstComponent(), currentWindow);
      readExternalPanel(second, (JPanel) splitter.getSecondComponent(), currentWindow);
    } else {
      readExternalPanel(first, panel, currentWindow);
      readExternalPanel(second, panel, currentWindow);
    }
    return panel;
  }
 private JComponent createAddPrefixComponent(final SourceFolder folder) {
   final IconActionComponent iconComponent =
       new IconActionComponent(
           ADD_PREFIX_ICON,
           ADD_PREFIX_ROLLOVER_ICON,
           ProjectBundle.message("module.paths.package.prefix.tooltip"),
           new Runnable() {
             public void run() {
               final String message =
                   ProjectBundle.message(
                       "module.paths.package.prefix.prompt",
                       toRelativeDisplayPath(folder.getUrl(), getContentEntry().getUrl() + ":"));
               final String prefix =
                   Messages.showInputDialog(
                       JavaContentRootPanel.this,
                       message,
                       ProjectBundle.message("module.paths.package.prefix.title"),
                       Messages.getQuestionIcon(),
                       folder.getPackagePrefix(),
                       null);
               if (prefix != null) {
                 myCallback.setPackagePrefix(folder, prefix);
               }
             }
           });
   final JPanel panel = new JPanel(new BorderLayout());
   panel.setOpaque(false);
   panel.add(iconComponent, BorderLayout.CENTER);
   panel.add(Box.createHorizontalStrut(3), BorderLayout.EAST);
   return panel;
 }
示例#21
0
  /** GUIコンポーネントを初期化する。 */
  public void initComponent() {

    frame = new JFrame(ClientContext.getFrameTitle(title));
    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    frame.addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
            stop();
          }
        });

    JPanel contentPane = createBrowsePane();
    contentPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11));

    contentPane.setOpaque(true);
    frame.setContentPane(contentPane);
    frame.pack();

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    int n = ClientContext.isMac() ? 3 : 2;
    int x = (screen.width - frame.getPreferredSize().width) / 2;
    int y = (screen.height - frame.getPreferredSize().height) / n;
    frame.setLocation(x, y);

    blockGlass = new BlockGlass();
    frame.setGlassPane(blockGlass);

    frame.setVisible(true);
  }
示例#22
0
  /** Sets opaqueness of this entry. */
  public void setOpaque(boolean opaque) {
    if (guiInitialized) {
      moneyField.setOpaque(opaque);
    }

    super.setOpaque(opaque);
  }
  public UpgradesPanel(ORUIManager orUIManager) {
    super(BoxLayout.Y_AXIS);

    this.orUIManager = orUIManager;

    preferredSize = new Dimension((int) Math.round(100 * (2 + Scale.getFontScale()) / 3), 200);
    setSize(preferredSize);
    setVisible(true);

    upgradePanel = new JPanel();

    upgradePanel.setOpaque(true);
    upgradePanel.setBackground(Color.DARK_GRAY);
    upgradePanel.setBorder(border);
    upgradePanel.setLayout(new GridLayout(defaultNbPanelElements, 1));

    scrollPane = new JScrollPane(upgradePanel);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setSize(getPreferredSize());

    doneButton.setActionCommand("Done");
    doneButton.setMnemonic(KeyEvent.VK_D);
    doneButton.addActionListener(this);
    cancelButton.setActionCommand("Cancel");
    cancelButton.setMnemonic(KeyEvent.VK_C);
    cancelButton.addActionListener(this);

    add(scrollPane);
  }
示例#24
0
  private Component buildMainPanel() {
    FormLayout layout =
        new FormLayout("pref, $lcgap, pref, 15dlu, p", "p, 5dlu, p, 5dlu, p, 5dlu, p");
    PanelBuilder builder = new PanelBuilder(layout);

    builder.setDefaultDialogBorder();
    builder.setOpaque(false);

    CellConstraints cc = new CellConstraints();

    builder.addSeparator(entity.getId(), cc.xyw(1, 1, 3));
    builder.addLabel("Start", cc.xy(1, 3));
    builder.add(jtflStart, cc.xy(3, 3));
    builder.addLabel("End", cc.xy(1, 5));
    builder.add(jtflEnd, cc.xy(3, 5));
    builder.addLabel("Increment", cc.xy(1, 7));
    builder.add(jtflInc, cc.xy(3, 7));

    builder.add(jbtnOK, cc.xy(5, 1));
    builder.add(jbtnCancel, cc.xy(5, 3));

    JPanel panel = builder.getPanel();
    panel.setOpaque(false);

    return panel;
  }
  // Create the content pane which displays the buttons and widgets on-screen.
  private JPanel createContentPane() {
    JPanel totalGUI = new JPanel(new BorderLayout(10, 10));

    input = new JTextField("0.0", 8);
    input.setEditable(false);

    // Use GridLayout for equals positioning.
    JPanel action_buttons = new JPanel(new GridLayout(4, 1));

    for (int i = 0; i < button_name.length; i++) {
      button_array[i] = new JButton(button_name[i]);
      action_buttons.add(button_array[i]);
    }

    // *** NEW ***
    // Added a panel for the numbered buttons on the page.

    JPanel number_buttons = new JPanel(new GridLayout(4, 3));

    for (int i = 0; i < numbered_name.length; i++) {
      numbered_array[i] = new JButton(numbered_name[i]);
      numbered_array[i].addActionListener(this);
      numbered_array[i].setActionCommand(numbered_name[i]);
      number_buttons.add(numbered_array[i]);
    }

    totalGUI.add(input, BorderLayout.PAGE_START);
    totalGUI.add(number_buttons, BorderLayout.CENTER);
    totalGUI.add(action_buttons, BorderLayout.LINE_END);

    totalGUI.setOpaque(true);
    return totalGUI;
  }
  private JComponent createSettingsPanel() {
    JPanel result = new JPanel(new FlowLayout(FlowLayout.RIGHT, 3, 0));
    result.add(new JLabel(ApplicationBundle.message("label.font.size")));
    myFontSizeSlider = new JSlider(JSlider.HORIZONTAL, 0, FontSize.values().length - 1, 3);
    myFontSizeSlider.setMinorTickSpacing(1);
    myFontSizeSlider.setPaintTicks(true);
    myFontSizeSlider.setPaintTrack(true);
    myFontSizeSlider.setSnapToTicks(true);
    UIUtil.setSliderIsFilled(myFontSizeSlider, true);
    result.add(myFontSizeSlider);
    result.setBorder(BorderFactory.createLineBorder(UIUtil.getBorderColor(), 1));

    myFontSizeSlider.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            if (myIgnoreFontSizeSliderChange) {
              return;
            }
            EditorColorsManager colorsManager = EditorColorsManager.getInstance();
            EditorColorsScheme scheme = colorsManager.getGlobalScheme();
            scheme.setQuickDocFontSize(FontSize.values()[myFontSizeSlider.getValue()]);
            applyFontSize();
          }
        });

    String tooltipText = ApplicationBundle.message("quickdoc.tooltip.font.size.by.wheel");
    result.setToolTipText(tooltipText);
    myFontSizeSlider.setToolTipText(tooltipText);
    result.setVisible(false);
    result.setOpaque(true);
    myFontSizeSlider.setOpaque(true);
    return result;
  }
示例#27
0
  public void buildNorth() {

    title.setFont(titleFont);
    list.add(0, "Select Planet");
    list.add(1, "Mercury");
    list.add(2, "Venus");
    list.add(3, "Earth");
    list.add(4, "Mars");
    list.add(5, "Asteroids");
    list.add(6, "Jupiter");
    list.add(7, "Saturn");
    list.add(8, "Uranus");
    list.add(9, "Neptune");
    list.add(10, "Pluto");
    ImageIcon fig = new ImageIcon(getImage(getCodeBase(), "Images/ss.jpg"));
    display = new JLabel(fig);
    factChoice.addItem("Select Fact");
    factChoice.addItem("Volume");
    factChoice.addItem("Surface Area");
    factChoice.addItem("Density");
    factChoice.addItem("Temperature");
    factChoice.addItem("Distance From Earth");
    factChoice.addItem("Diameter");

    pNorth1.setOpaque(false);
    pNorth2.setOpaque(false);
    pNorth3.setOpaque(false);
    pNorth4.setOpaque(false);
    pNorth5.setOpaque(false);
    moons.setOpaque(false);
    whatUnits.setOpaque(false);

    add("North", pNorth1);
    pNorth1.add(pNorth2);
    pNorth2.add(planets);
    pNorth1.add(display);
    pNorth1.add(pNorth3);
    pNorth3.add("North", factChoice);
    pNorth3.add("Center", pNorth4);
    pNorth4.add(moons);
    pNorth4.add(whatUnits);
    pNorth3.add("South", pNorth5);
    pNorth5.add(fact);
    pNorth5.add(units);
    pNorth5.add(select);
    pNorth5.add(clear);
  }
示例#28
0
  public InfoAndProgressPanel() {

    setOpaque(false);

    myRefreshIcon = new RefreshFileSystemIcon();
    //  new AsyncProcessIcon("Refreshing filesystem") {
    //  protected Icon getPassiveIcon() {
    //    return myEmptyRefreshIcon;
    //  }
    //
    //  @Override
    //  public Dimension getPreferredSize() {
    //    if (!isRunning()) return new Dimension(0, 0);
    //    return super.getPreferredSize();
    //  }
    //
    //  @Override
    //  public void paint(Graphics g) {
    //    g.translate(0, -1);
    //    super.paint(g);
    //    g.translate(0, 1);
    //  }
    // };

    myRefreshIcon.setPaintPassiveIcon(false);

    myRefreshAndInfoPanel.setLayout(new BorderLayout());
    myRefreshAndInfoPanel.setOpaque(false);
    myRefreshAndInfoPanel.add(myRefreshIcon, BorderLayout.WEST);
    myRefreshAndInfoPanel.add(myInfoPanel, BorderLayout.CENTER);

    myProgressIcon = new AsyncProcessIcon("Background process");
    myProgressIcon.setOpaque(false);

    myProgressIcon.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mousePressed(MouseEvent e) {
            handle(e);
          }

          @Override
          public void mouseReleased(MouseEvent e) {
            handle(e);
          }
        });

    myProgressIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    myProgressIcon.setBorder(StatusBarWidget.WidgetBorder.INSTANCE);
    myProgressIcon.setToolTipText(ActionsBundle.message("action.ShowProcessWindow.double.click"));

    myUpdateQueue =
        new MergingUpdateQueue("Progress indicator", 50, true, MergingUpdateQueue.ANY_COMPONENT);
    myPopup = new ProcessPopup(this);

    setRefreshVisible(false);

    restoreEmptyStatus();
  }
示例#29
0
  private void showAlignment() {

    int[] selRows = dataTable.getSelectedRows();
    for (int row : selRows) {
      AbstractPartitionData partition = options.dataPartitions.get(row);
      Alignment alignment = null;

      if (partition instanceof PartitionData)
        alignment = ((PartitionData) partition).getAlignment();

      // alignment == null if partition is trait or microsat
      // http://code.google.com/p/beast-mcmc/issues/detail?id=343
      if (alignment == null) {
        JOptionPane.showMessageDialog(
            this,
            "Cannot display traits or microsatellite data currently.\nUse the traits panel to view and edit traits.",
            "Illegal Argument Exception",
            JOptionPane.ERROR_MESSAGE);
        return;
      }

      JFrame frame = new JFrame();
      frame.setSize(800, 600);

      AlignmentViewer viewer = new AlignmentViewer();
      if (alignment.getDataType().getType() == DataType.NUCLEOTIDES) {
        viewer.setCellDecorator(new StateCellDecorator(new NucleotideDecorator(), false));
      } else if (alignment.getDataType().getType() == DataType.AMINO_ACIDS) {
        viewer.setCellDecorator(new StateCellDecorator(new AminoAcidDecorator(), false));
      } else {
        // no colouring
      }
      viewer.setAlignmentBuffer(new BeautiAlignmentBuffer(alignment));

      JPanel panel = new JPanel(new BorderLayout());
      panel.setOpaque(false);
      panel.add(viewer, BorderLayout.CENTER);

      JPanel infoPanel = new JPanel(new BorderLayout());
      infoPanel.setOpaque(false);
      panel.add(infoPanel, BorderLayout.SOUTH);

      frame.setContentPane(panel);
      frame.setVisible(true);
    }
  }
  private void populateTournamentActive() {

    lblTitle.setText(
        "Quest Mode: Draft Tournament - "
            + FModel.getQuest().getAchievements().getCurrentDraft().getTitle());
    VHomeUI.SINGLETON_INSTANCE
        .getPnlDisplay()
        .setLayout(new MigLayout("insets 0, gap 0, ax center, wrap 1"));
    VHomeUI.SINGLETON_INSTANCE
        .getPnlDisplay()
        .add(lblTitle, "w 80%!, h 40px!, gap 20% 0 15px 10px, ax right, span 2");

    FScrollPanel panel =
        new FScrollPanel(
            new MigLayout("insets 0, gap 0, wrap 4, ax center"),
            true,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    String constraintsLeft = "w 350px!, h 196px!, gap 0px 0px 0px 0px, ay center";
    String constraintsMiddle = "w 350px!, h 392px!, gap 0px 0px 0px 0px, ay center";
    String constraintsRight = "w 350px!, h 784px!, gap 0px 0px 0px 0px, ay center";

    panel.add(matchups[0], constraintsLeft);
    panel.add(matchups[4], constraintsMiddle + ", span 1 2");
    panel.add(matchups[6], constraintsRight + ", span 1 4");
    panel.add(matchups[7], constraintsRight + ", span 1 4");
    panel.add(matchups[1], constraintsLeft);
    panel.add(matchups[2], constraintsLeft);
    panel.add(matchups[5], constraintsMiddle + ", span 1 2");
    panel.add(matchups[3], constraintsLeft);

    VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(panel, "gap 0 0 0 0, ax center");

    btnEditDeck.setFontSize(12);

    JPanel bottomButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 2, ax center"));

    if (FModel.getQuest().getAchievements().getCurrentDraft().playerHasMatchesLeft()) {

      VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(btnStartMatch, "gap 0 0 0 20px, ax center");
      bottomButtons.add(btnEditDeck, "w 135px!, h 25px!, gap 0 25px 10px 10px, ax right");
      bottomButtons.add(btnLeaveTournament, "w 135px!, h 25px!, gap 25px 0 10px 10px, ax right");
      btnLeaveTournament.setFontSize(12);

    } else {

      VHomeUI.SINGLETON_INSTANCE
          .getPnlDisplay()
          .add(btnLeaveTournament, "w 250px!, h 60px!, gap 0 0 20px 20px, ax center");
      bottomButtons.add(btnEditDeck, "w 135px!, h 25px!, gap 0 25px 10px 10px, ax right");
      bottomButtons.add(btnStartMatchSmall, "w 135px!, h 25px!, gap 25px 0 10px 10px, ax right");
      btnLeaveTournament.setFontSize(24);
    }

    VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(bottomButtons, "w 100%!");
    bottomButtons.setOpaque(false);
  }