예제 #1
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();
  }
  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();
  }
예제 #3
0
 public DefaultBuildQueueCellRenderer() {
   itemPanel.setOpaque(false);
   itemPanel.setLayout(new MigLayout());
   selectedPanel.setOpaque(false);
   selectedPanel.setLayout(new MigLayout());
   selectedPanel.setUI((PanelUI) FreeColSelectedPanelUI.createUI(selectedPanel));
 }
예제 #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);
  }
예제 #5
0
  /** Creates a new panel */
  public GraphPanel() {
    setLayout(null);

    canvas = createCanvas();
    canvas.setLayout(null);
    canvas.setBackground(Color.WHITE);
    canvas.setOpaque(true);
    canvas.setFocusable(true);

    overlay = createOverlay();
    overlay.setOpaque(false);
    overlay.setFocusable(false);

    add(overlay);
    add(canvas);

    graphListener = graphListener();

    capabilityController = new CapabilityController(this);
    capabilityController.register(CapabilityName.MOVEABLE, new MoveableCapabilityHandler());
    capabilityController.register(CapabilityName.SELECTABLE, new SelectableCapabilityHandler());
    capabilityController.register(CapabilityName.CONTEXT_MENU, new ContextCapabilityHandler());

    addComponentListener(
        new ComponentAdapter() {
          @Override
          public void componentResized(ComponentEvent e) {
            regraph();
          }

          public void componentShown(ComponentEvent e) {
            regraph();
          }
        });
  }
예제 #6
0
  private void themeing() {

    aboutDialogLogger.entry();
    Color color = new Color(0, 0, 0, 0);

    mainPanel.setOpaque(false);
    mainPanel.setBackground(new Color(51, 181, 229));

    programLabel.setFont(new Font(programLabel.getFont().getName(), Font.BOLD, 24));

    displayPanel.setOpaque(false);

    licenseScrollPane.setOpaque(false);
    licenseScrollPane.getViewport().setOpaque(false);
    licenseScrollPane.setBorder(null);
    licenseScrollPane.setViewportBorder(null);
    licenseTextArea.setOpaque(false);
    licenseTextArea.setBackground(color);
    licenseTextArea.setEditable(false);

    developerScrollPane.setOpaque(false);
    developerScrollPane.getViewport().setOpaque(false);
    developerScrollPane.setBorder(null);
    developerScrollPane.setViewportBorder(null);
    developerPane.setOpaque(false);
    developerPane.setBackground(color);
    developerPane.setEditable(false);
    emptyPanel.setOpaque(false);
    aboutDialogLogger.exit(LoggerValues.SUCCESSFUL_EXIT);
  }
예제 #7
0
  private void setButton() {
    JPanel buttonSpace = new JPanel();

    JButton back = new JButton("<");
    JButton next = new JButton(">");
    JButton first = new JButton("<<");
    JButton last = new JButton(">>");

    buttonSpace.setOpaque(true);
    buttonSpace.setBackground(Color.GRAY);
    buttonSpace.setLayout(new BoxLayout(buttonSpace, BoxLayout.X_AXIS));
    buttonSpace.setPreferredSize(new Dimension(this.getPreferredSize().width, 20));
    bsWidth = this.getPreferredSize().width;
    bsLength = 20;
    buttonSpace.setBounds(0, 0, bsWidth, bsLength);
    buttonSpace.setVisible(true);
    this.add(buttonSpace, JLayeredPane.DEFAULT_LAYER);
    buttonSpace.setOpaque(true);

    buttonSpace.add(first);
    buttonSpace.add(back);
    buttonSpace.add(next);
    buttonSpace.add(last);

    first.setVisible(true);
    back.setVisible(true);
    next.setVisible(true);
    last.setVisible(true);

    first.addActionListener(this);
    back.addActionListener(this);
    next.addActionListener(this);
    last.addActionListener(this);
  }
예제 #8
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);
  }
 public StopRenderer() {
   NORMAL_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
   NORMAL_COMPONENT.setOpaque(false);
   SELECTED_COMPONENT.setLayout(new MigLayout("", "[80, center][]"));
   SELECTED_COMPONENT.setOpaque(false);
   SELECTED_COMPONENT.setUI((PanelUI) FreeColSelectedPanelUI.createUI(SELECTED_COMPONENT));
 }
예제 #10
0
  /** 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);
  }
예제 #11
0
 public void setOpaque(boolean b) {
   super.setOpaque(b);
   if (buttonPanel != null) buttonPanel.setOpaque(b);
   if (choicePanel != null) choicePanel.setOpaque(b);
   if (questionBody != null) questionBody.setOpaque(b);
   if (choices != null) {
     for (AbstractButton c : choices) c.setOpaque(b);
   }
 }
  SystemInformationsButtonsPanel(
      RemoteCollector remoteCollector, URL monitoringUrl, boolean collectorServer) {
    super(remoteCollector);
    this.javaInformationsList = getJavaInformationsList();
    this.monitoringUrl = monitoringUrl;

    if (collectorServer) {
      final JPanel currentRequestsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
      currentRequestsPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 15, 0));
      currentRequestsPanel.setOpaque(false);
      currentRequestsPanel.add(createCurrentRequestsButton());
      add(currentRequestsPanel, BorderLayout.NORTH);
    }
    if (Parameters.isSystemActionsEnabled()) {
      final JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 0));
      centerPanel.setOpaque(false);
      final JPanel southPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 0));
      southPanel.setOpaque(false);

      centerPanel.add(createGcButton());
      centerPanel.add(createHeapDumpButton());
      centerPanel.add(createHeapHistoButton());

      if (isSessionsEnabled()) {
        centerPanel.add(createInvalidateSessionsButton());
        centerPanel.add(createSessionsButton());
      }

      centerPanel.add(createHotspotsButton());

      if (doesWebXmlExists()) {
        // on n'affiche le lien web.xml que si le fichier existe (pour api servlet 3.0 par ex)
        southPanel.add(createWebXmlButton());
      }

      southPanel.add(createMBeansButton());
      southPanel.add(createProcessesButton());

      final String serverInfo = javaInformationsList.get(0).getServerInfo();
      if (serverInfo != null && !serverInfo.contains("Winstone")) {
        // on n'affiche pas le lien JNDI si serveur Winstone car cela n'a pas d'intérêt
        // pour Hudson/Jenkins sous Winstone, et surtout car (Winstone)Context.listBindings
        // renvoie une liste de NameClassPair au lieu d'une liste de Binding comme il le devrait

        southPanel.add(createJndiButton());
      }

      if (isDatabaseEnabled()) {
        southPanel.add(createConnectionsButton());

        southPanel.add(createDatabaseButton());
      }

      add(centerPanel, BorderLayout.CENTER);
      add(southPanel, BorderLayout.SOUTH);
    }
  }
예제 #13
0
  public static void showPopup(Component parent, String title, String message, int x, int y) {
    JLabel descr = new JLabel(message);
    JLabel tit = new JLabel(title);

    JPanel pn = new JPanel(new BorderLayout());
    JPanel tpn = new JPanel(new GridBagLayout());
    tpn.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.GRAY));
    CloseButton cb = new CloseButton();
    tpn.add(
        cb,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0,
            0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(2, 0, 5, 0),
            0,
            0));
    tpn.add(
        tit,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1.0,
            0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 0, 2, 5),
            0,
            0));
    tpn.setOpaque(false);
    pn.add(tpn, BorderLayout.NORTH);
    pn.add(descr, BorderLayout.CENTER);
    //    pn.setFont(new Font("Dialog", Font.PLAIN, 11));
    pn.setBackground(SystemColor.info);
    pn.setForeground(SystemColor.infoText);
    pn.setOpaque(true);
    pn.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK),
            BorderFactory.createEmptyBorder(0, 5, 5, 5)));

    final Popup p = PopupFactory.getSharedInstance().getPopup(parent, pn, x, y);
    cb.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            p.hide();
          }
        });
    p.show();
  }
예제 #14
0
 /**
  * Builds and lays out the tool bar.
  *
  * @return See above.
  */
 private JPanel buildToolBar() {
   JPanel bar = new JPanel();
   bar.setOpaque(true);
   bar.setBorder(null);
   bar.add(finishButton);
   bar.add(Box.createRigidArea(H_SPACER_SIZE));
   bar.add(cancelButton);
   JPanel p = UIUtilities.buildComponentPanelRight(bar);
   p.setOpaque(true);
   return p;
 }
  public ScrollingTeamListPanel(int numColumns) {
    this.numColumns = numColumns;

    setLayout(null);
    setOpaque(false);

    rootPanel = new JPanel(new MigLayout("ins 0, fillx"));
    ((MigLayout) rootPanel.getLayout()).setRowConstraints("[]0[]");
    ((MigLayout) rootPanel.getLayout()).setColumnConstraints("[]0[]");
    rootPanel.setOpaque(false);

    panelA = new JPanel();
    panelA.setLayout(new MigLayout("ins 0, fillx"));
    panelA.setOpaque(false);

    panelB = new JPanel();
    panelB.setLayout(new MigLayout("ins 0, fillx"));
    panelB.setOpaque(false);

    rootPanel.add(panelA, "w 80%, gapleft 10%, wrap");
    rootPanel.add(panelB, "w 80%, gapleft 10%, wrap");
    add(rootPanel);

    ComponentListener resizeListener =
        new ComponentListener() {
          public void componentHidden(ComponentEvent arg0) {}

          public void componentMoved(ComponentEvent arg0) {}

          public void componentResized(ComponentEvent arg0) {
            updatePositions();
          }

          public void componentShown(ComponentEvent arg0) {}
        };

    addComponentListener(resizeListener);
    panelA.addComponentListener(resizeListener);

    ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();

    ses.scheduleAtFixedRate(
        new Runnable() {
          public void run() {
            updateScrolling();
          }
        },
        0,
        SCROLL_MILLISECONDS,
        TimeUnit.MILLISECONDS);

    updatePositions();
  }
예제 #16
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);
  }
  /**
   * Construct with the given dimensions
   *
   * @param width the width
   * @param height the height
   * @throws VideoCaptureException
   */
  public VideoCaptureComponent(int width, int height, String devName) throws VideoCaptureException {
    super(BoxLayout.Y_AXIS);

    this.setOpaque(false);

    this.width = width;
    this.height = height;
    final List<Device> devices = VideoCapture.getVideoDevices();

    Video<MBFImage> vc = null;
    if (devices == null || devices.size() == 0) {
      currentDevice = null;

      final MBFImage[] frames = {new MBFImage(width, height, ColourSpace.RGB)};
      frames[0].fill(RGBColour.RED);
      vc = new ArrayBackedVideo<MBFImage>(frames);
    } else {
      for (final Device d : devices) {
        if (d.getNameStr().contains(devName)) {
          currentDevice = d;
          break;
        }
      }

      if (currentDevice == null) currentDevice = devices.get(0);

      vc = new VideoCapture(width, height, currentDevice);
    }

    final JPanel videoDisplayPanel = new JPanel();
    videoDisplayPanel.setMinimumSize(new Dimension(width, height));
    videoDisplayPanel.setOpaque(false);
    display = VideoDisplay.createVideoDisplay(vc, videoDisplayPanel);
    add(videoDisplayPanel);

    final JPanel sourcesPanel = new JPanel();
    sourcesPanel.setOpaque(false);
    sources = new JComboBox<String>();
    sources.setOpaque(false);
    if (devices == null || devices.size() == 0) {
      sources.addItem("No cameras found");
      sources.setEnabled(false);
    } else {
      for (final Device s : devices) sources.addItem(s.getNameStr());
    }

    sources.setSelectedItem(currentDevice.getNameStr());

    sources.addItemListener(this);
    sourcesPanel.add(sources);
    add(sourcesPanel);
  }
예제 #18
0
  /**
   * <i>Description:</i>
   *
   * <p>see <a href=https://en.wikipedia.org/wiki/Hostname>https://en.wikipedia.org
   * /wiki/Hostname</a> for valid hostname
   *
   * @return
   */
  @SuppressWarnings("unchecked")
  protected JPanel getHostEntryPanel() {
    if (pnlHostEntry == null) {
      pnlHostEntry = new JPanel(new BorderLayout(5, 5));
      pnlHostEntry.setOpaque(false);

      JPanel panel = new JPanel(new GridLayout(1, 2, 10, 5));
      panel.setOpaque(false);
      String hostNameChars = UIConstants.DIGITS + UIConstants.LETTERS + "-.";
      txtFldHostName = new SafeTextField(false, 253);
      ((SafeTextField) txtFldHostName).setValidChars(hostNameChars);
      for (DocumentListener listener : hostInfoListener.getDocumentListeners()) {
        txtFldHostName.getDocument().addDocumentListener(listener);
      }
      FieldPair<JFormattedTextField> fp =
          new FieldPair<JFormattedTextField>(STLConstants.K0051_HOST.getValue(), txtFldHostName);
      panel.add(fp);

      txtFldPortNum =
          new SafeNumberField<Integer>(new DecimalFormat("###"), 0, false, 65535, false);
      // only positive integer
      ((SafeNumberField<Integer>) txtFldPortNum).setValidChars(UIConstants.DIGITS);
      for (DocumentListener listener : hostInfoListener.getDocumentListeners()) {
        txtFldPortNum.getDocument().addDocumentListener(listener);
      }
      txtFldPortNum.setText(STLConstants.K3015_DEFAULT_PORT.getValue());
      fp =
          new FieldPair<JFormattedTextField>(
              STLConstants.K1035_CONFIGURATION_PORT.getValue(), txtFldPortNum);
      panel.add(fp);
      pnlHostEntry.add(panel, BorderLayout.CENTER);

      chkboxSecureConnect =
          ComponentFactory.getIntelCheckBox(STLConstants.K2003_SECURE_CONNECT.getValue());
      chkboxSecureConnect.setFont(UIConstants.H5_FONT.deriveFont(Font.BOLD));
      chkboxSecureConnect.setForeground(UIConstants.INTEL_DARK_GRAY);
      chkboxSecureConnect.setHorizontalAlignment(JLabel.TRAILING);
      chkboxSecureConnect.setSelected(false);
      chkboxSecureConnect.addItemListener(
          new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
              hostInfoListener.setDirty();
              boolean isSecureConnect = chkboxSecureConnect.isSelected();
              enableCerts(isSecureConnect);
            }
          });
      pnlHostEntry.add(chkboxSecureConnect, BorderLayout.EAST);
    }
    return pnlHostEntry;
  }
예제 #19
0
  /**
   * Constructor: Initialises the screen that shows the final results after a tournament.
   *
   * @param game the ant-game controller that this screen is a part of.
   */
  public TournamentResultsPanel(Game game) {
    this.game = game;
    this.setLayout(new BorderLayout());

    // Create title container
    JPanel titleContainer = new JPanel();
    BoxLayout titleLayout = new BoxLayout(titleContainer, BoxLayout.Y_AXIS);
    titleContainer.setLayout(titleLayout);
    titleContainer.add(new FixedSpacerPanel(100, 20));
    titleContainer.add(new ImagePanel(TITLE_IMAGE));
    titleContainer.add(new FixedSpacerPanel(100, 20));
    titleContainer.setOpaque(false);

    // The ranking list
    itemPanel = new JPanel();
    BoxLayout itemPanelLayout = new BoxLayout(itemPanel, BoxLayout.Y_AXIS);
    itemPanel.setLayout(itemPanelLayout);

    listHolder = new JScrollPane(itemPanel);
    listHolder.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    listHolder.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    listHolder.setPreferredSize(new Dimension(900, 330));
    listHolder.setOpaque(true);

    // Panel that will be added to the centre of the screen;
    JPanel centrePanel = new JPanel();
    centrePanel.setOpaque(false);
    centrePanel.add(listHolder);

    JPanel mainMenuButtonPanel = new JPanel();
    mainMenuButtonPanel.setOpaque(false);

    // Button to go back to the main menu.
    ImageButton mainMenuButton =
        new ImageButton(MAIN_MENU_BUTTON_IMAGE, MAIN_MENU_BUTTON_HOVER) {
          private static final long serialVersionUID = -9185178128811873837L;

          public void mouseClicked(MouseEvent e) {
            getGame().switchScreen(Game.MAIN_MENU_SCREEN);
          }
        };

    mainMenuButtonPanel.add(mainMenuButton);
    mainMenuButtonPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 20, 0));

    // Add the panels to the main panel
    this.add(titleContainer, BorderLayout.NORTH);
    this.add(centrePanel, BorderLayout.CENTER);
    this.add(mainMenuButtonPanel, BorderLayout.SOUTH);
  }
예제 #20
0
 /** Creates the layout of the panel (but the contents are not populated here). */
 private void createLayout() {
   GridBagConstraints gbc = new GridBagConstraints();
   CardLayout cardLayout = new CardLayout();
   mainPanel = new JPanel(cardLayout);
   mainPanel.setOpaque(false);
   noEntryPanel.setMessage(INFO_CTRL_PANEL_NO_SCHEMA_ITEM_SELECTED_LABEL.get());
   mainPanel.add(noEntryPanel, NOTHING_SELECTED);
   StatusGenericPanel[] panelsWithScroll = {
     standardObjectClassPanel,
     configurationObjectClassPanel,
     standardAttributePanel,
     configurationAttributePanel,
     matchingRulePanel,
     attributeSyntaxPanel
   };
   StatusGenericPanel[] panelsWithNoScroll = {customObjectClassPanel, customAttributePanel};
   for (StatusGenericPanel panel : panelsWithScroll) {
     mainPanel.add(Utilities.createBorderLessScrollBar(panel), panel.getTitle().toString());
   }
   for (StatusGenericPanel panel : panelsWithNoScroll) {
     mainPanel.add(panel, panel.getTitle().toString());
   }
   cardLayout.show(mainPanel, NOTHING_SELECTED);
   gbc.gridx = 0;
   gbc.gridy = 0;
   gbc.weightx = 1.0;
   gbc.weighty = 1.0;
   gbc.fill = GridBagConstraints.BOTH;
   add(mainPanel, gbc);
 }
  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;
  }
 public ReceiveAddressDialog(JDialog parent) {
   super(parent, "Receive Addresses", Dialog.ModalityType.DOCUMENT_MODAL);
   setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
   tableModel = new AddressTableModel(columnNames, columnClasses);
   table = new AddressTable(tableModel, columnTypes);
   table.setRowSorter(new TableRowSorter<>(tableModel));
   table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
   scrollPane = new JScrollPane(table);
   JPanel tablePane = new JPanel();
   tablePane.setBackground(Color.WHITE);
   tablePane.add(Box.createGlue());
   tablePane.add(scrollPane);
   tablePane.add(Box.createGlue());
   JPanel buttonPane =
       new ButtonPane(
           this,
           10,
           new String[] {"New", "new"},
           new String[] {"Copy", "copy"},
           new String[] {"Edit", "edit"},
           new String[] {"Done", "done"});
   buttonPane.setBackground(Color.white);
   JPanel contentPane = new JPanel();
   contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
   contentPane.setOpaque(true);
   contentPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
   contentPane.setBackground(Color.WHITE);
   contentPane.add(tablePane);
   contentPane.add(buttonPane);
   setContentPane(contentPane);
 }
예제 #23
0
  @Override
  public void initUi() {
    try {
      MigLayout layout = new MigLayout("insets 1", "[fill,grow]", "[top][fill,grow]");
      setLayout(layout);
      setOpaque(false);

      // date
      StrandDateLabel lbDate = new StrandDateLabel(strand, date);
      add(lbDate, "wrap");

      // scenes by strand and date
      BookModel model = mainFrame.getBookModel();
      Session session = model.beginTransaction();
      SceneDAOImpl sceneDao = new SceneDAOImpl(session);
      List<Scene> sceneList = sceneDao.findByStrandAndDate(strand, date);
      model.commit();
      if (sceneList.isEmpty()) {
        SpacePanel spacePanel = new SpacePanel(mainFrame, strand, date);
        add(spacePanel, "grow");
      } else {
        MigLayout layout2 = new MigLayout("insets 0", "[]", "[top]");
        JPanel colPanel = new JPanel(layout2);
        colPanel.setOpaque(false);
        for (Scene scene : sceneList) {
          ChronoScenePanel csp = new ChronoScenePanel(mainFrame, scene);
          colPanel.add(csp, "grow");
        }
        add(colPanel, "grow");
      }
    } catch (Exception e) {
    }
  }
  public void init() {
    JPanel main_jp = new BorderJPanel();
    BoxLayout boxLayout = new BoxLayout(main_jp, BoxLayout.Y_AXIS);
    main_jp.setLayout(boxLayout);
    main_jp.setBackground(Util.PANEL_COLOR);

    number = new JLabelJTextFieldComponent("  *", "仓库编号:", 30);
    name = new JLabelJTextFieldComponent("  *", "仓库名称:", 30);
    location = new JLabelJTextFieldComponent("  *", "仓库地址:", 30);
    manager = new JLabelJComboBoxComponent("*", "仓库管理员:", new String[] {}, 188);
    manager.addElement(new IDNameBean("0", "请选择"));
    priority = new JLabelJTextFieldComponent("*", "仓库优先级:", "(数字越大,越在前面)", 15);
    note = new JLabelJTextAreaComponent("    备    注:", 23, 3);

    number.getText().setText(UUID.GenUUID15());
    number.getText().setEditable(false);
    priority.getText().setText("0");

    main_jp.add(number);
    main_jp.add(name);
    main_jp.add(location);
    main_jp.add(manager);
    main_jp.add(priority);
    main_jp.add(note);

    JPanel p1 = new JPanel();
    sureButton = new RPJButtonWhite("保存(Ctrl+S)");
    cancelButton = new RPJButtonWhite("取消(Ctrl+Q)");
    p1.add(sureButton);
    p1.add(cancelButton);
    p1.setOpaque(false);
    main_jp.add(p1);
    this.add(main_jp);
    main_jp.setCursor(Util.CURSOR_DEFAULT);
  }
 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;
 }
  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);
  }
예제 #27
0
 /**
  * Creates a new wait dialog with the specified information
  *
  * @param owner Parent frame of the new dialog
  * @param title Title of the dialog
  * @param message Message to be displayed within the dialog.
  */
 public WaitDialog(Frame owner, String title, String message) {
   super(owner, title, false);
   this.title = title;
   this.message = message;
   this.setSize(300, 150);
   JPanel contentPanel = new JPanel();
   contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
   contentPanel.add(Box.createVerticalGlue());
   JLabel messageLabel = new JLabel(message);
   messageLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
   contentPanel.add(messageLabel);
   contentPanel.add(Box.createVerticalStrut(10));
   JProgressBar waitBar = new JProgressBar();
   waitBar.setIndeterminate(true);
   waitBar.setAlignmentX(JProgressBar.CENTER_ALIGNMENT);
   JPanel waitBarPanel = new JPanel();
   waitBarPanel.setOpaque(false);
   waitBarPanel.setLayout(new BoxLayout(waitBarPanel, BoxLayout.X_AXIS));
   waitBarPanel.add(Box.createHorizontalGlue());
   waitBarPanel.add(waitBar);
   waitBarPanel.add(Box.createHorizontalGlue());
   contentPanel.add(waitBarPanel);
   contentPanel.add(Box.createVerticalGlue());
   this.add(contentPanel);
   this.setLocationRelativeTo(owner);
 }
예제 #28
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);
  }
  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);
  }
예제 #30
0
파일: EditorPane.java 프로젝트: hencjo/jOOQ
 private JPanel addResultPane() {
   JPanel resultPane = new JPanel(new BorderLayout());
   resultPane.setOpaque(false);
   int componentCount = southPanel.getComponentCount();
   if (componentCount == 0) {
     southPanel.add(resultPane, BorderLayout.CENTER);
     southPanel.revalidate();
     southPanel.repaint();
   } else {
     JTabbedPane tabbedPane;
     Component component0 = southPanel.getComponent(0);
     if (component0 instanceof JTabbedPane) {
       tabbedPane = (JTabbedPane) component0;
     } else {
       JPanel query1Panel = (JPanel) component0;
       southPanel.remove(0);
       tabbedPane = new JTabbedPane();
       tabbedPane.addTab("Query 1", query1Panel);
       southPanel.add(tabbedPane, BorderLayout.CENTER);
       southPanel.revalidate();
       southPanel.repaint();
     }
     tabbedPane.addTab("Query " + (tabbedPane.getTabCount() + 1), resultPane);
   }
   return resultPane;
 }