Java Code Examples for javax.swing.JSplitPane#setOrientation()

The following examples show how to use javax.swing.JSplitPane#setOrientation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainView.java    From HiJson with Apache License 2.0 7 votes vote down vote up
private void codeChangeAction(){
    javax.swing.JDialog dlg = new javax.swing.JDialog(getFrame());
    dlg.setTitle(resourceMap.getString("menuItemCode.text"));
    dlg.setSize(500, 350);
    dlg.setMinimumSize(new Dimension(500, 350));
    JSplitPane spiltPane2 = new JSplitPane();
    spiltPane2.setDividerLocation(150);
    spiltPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);

    final JTextArea textAreaSrc = new JTextArea();
    final JTextArea textAreaDest = new JTextArea();
    textAreaSrc.setLineWrap(true);
    textAreaDest.setLineWrap(true);

    spiltPane2.setTopComponent(new JScrollPane(textAreaSrc));
    spiltPane2.setBottomComponent(new JScrollPane(textAreaDest));

    JButton btnOK = new JButton("转换");
    btnOK.setSize(50, 25);
    java.awt.Container pane = dlg.getContentPane();
    BorderLayout layout = new BorderLayout();
    //layout.addLayoutComponent(spiltPane, BorderLayout.CENTER);
   // layout.addLayoutComponent(btnOK, BorderLayout.SOUTH);
    pane.setLayout(layout);
    pane.add(spiltPane2,  BorderLayout.CENTER);
    pane.add(btnOK,  BorderLayout.SOUTH);

    btnOK.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String str = textAreaSrc.getText();
            str = StringEscapeUtils.unescapeJava(str);
            textAreaDest.setText(str);
        }
    });
    MainApp.getApplication().show(dlg);

}
 
Example 2
Source File: JSplitPaneBuilder.java    From triplea with GNU General Public License v3.0 6 votes vote down vote up
/** Builds the swing component. */
public JSplitPane build() {
  final JSplitPane pane = new JSplitPane();
  pane.setDividerLocation(dividerLocation);
  pane.setResizeWeight(extraSpaceToTopAndLeft ? 1.0 : 0.0);

  if (left != null) {
    Preconditions.checkNotNull(right);
    Preconditions.checkState(top == null);
    Preconditions.checkState(bottom == null);

    pane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    pane.setLeftComponent(left);
    pane.setRightComponent(right);
  } else {
    Preconditions.checkNotNull(top);
    Preconditions.checkNotNull(bottom);
    Preconditions.checkState(right == null);

    pane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    pane.setTopComponent(top);
    pane.setBottomComponent(bottom);
  }

  return pane;
}
 
Example 3
Source File: CSSStylesSelectionPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@code CSSStylesSelectionPanel}.
 */
CSSStylesSelectionPanel() {
    setLayout(new BorderLayout());
    JSplitPane splitPane = createSplitPane();
    splitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    splitPane.setTopComponent(initPropertyPane());
    splitPane.setBottomComponent(initRulePane());
    splitPane.setDividerSize(4);
    splitPane.setResizeWeight(0.5);
    splitPane.setBorder(null);
    selectionView = splitPane;
    initMessagePanel();
    initSelectionOfOwningRule();
    add(selectionView, BorderLayout.CENTER);
    updateContent(null, false);
}
 
Example 4
Source File: CProjectMainPanel.java    From binnavi with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the main split pane. The main split pane divides the main window into project tree on
 * the left side of the main window and the state-specific views on the right side of the main
 * window.
 * 
 * @return The main split pane.
 */
private JSplitPane createMainSplitPane() {
  final JSplitPane mainSplitPane = new JSplitPane();
  mainSplitPane.setOneTouchExpandable(true);
  mainSplitPane.setDividerLocation(250);
  mainSplitPane.setResizeWeight(0.33);
  mainSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);

  m_componentPanel.setBackground(Color.WHITE);

  mainSplitPane.setLeftComponent(createProjectTreePanel());
  mainSplitPane.setRightComponent(m_componentPanel);
  mainSplitPane.setBorder(new LineBorder(Color.GRAY));

  return mainSplitPane;
}
 
Example 5
Source File: ParameterDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected Component createContentPane() {
  final JSplitPane mainPanel = new JSplitPane();
  mainPanel.setOrientation( JSplitPane.HORIZONTAL_SPLIT );
  mainPanel.setLeftComponent( provisionDataSourcePanel );
  mainPanel.setRightComponent( createDetailsPanel() );
  mainPanel.setDividerLocation( 300 );
  return mainPanel;
}
 
Example 6
Source File: ConsolePanel.java    From zap-extensions with Apache License 2.0 5 votes vote down vote up
private void initialize() {
    this.setIcon(
            new ImageIcon(ZAP.class.getResource("/resource/icon/16/059.png"))); // 'script' icon
    this.setDefaultAccelerator(
            extension
                    .getView()
                    .getMenuShortcutKeyStroke(
                            KeyEvent.VK_C,
                            KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
                            false));
    this.setMnemonic(Constant.messages.getChar("scripts.panel.mnemonic"));
    this.setLayout(new BorderLayout());
    startPollingForChanges();

    runnableScriptsToThreadMap =
            Collections.synchronizedMap(
                    new HashMap<ScriptWrapper, WeakReference<ScriptExecutorThread>>());

    panelContent = new JPanel(new GridBagLayout());
    this.add(panelContent, BorderLayout.CENTER);

    JSplitPane splitPane = new JSplitPane();
    splitPane.setDividerSize(3);
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPane.setResizeWeight(0.5D);
    splitPane.setTopComponent(getCommandPanel());
    splitPane.setBottomComponent(getOutputPanel());

    panelContent.add(this.getPanelToolbar(), LayoutHelper.getGBC(0, 0, 1, 1.0D, 0.0D));
    panelContent.add(splitPane, LayoutHelper.getGBC(0, 1, 1, 1.0D, 1.0D));
}
 
Example 7
Source File: SamlMain.java    From SAMLRaider with MIT License 5 votes vote down vote up
private void initializeUI(){
	setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneMain = new JSplitPane();
	splitPaneMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
	add(splitPaneMain, BorderLayout.CENTER);
	
	JPanel panelTop = new JPanel();
	splitPaneMain.setLeftComponent(panelTop);
	panelTop.setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneTop = new JSplitPane();
	splitPaneTop.setResizeWeight(0.3);
	panelTop.add(splitPaneTop);
	
	panelAction = new SamlPanelAction(controller);
	splitPaneTop.setLeftComponent(panelAction);
	
	panelInformation = new SamlPanelInfo();
	splitPaneTop.setRightComponent(panelInformation);
	
	JPanel panelText = new JPanel();
	splitPaneMain.setRightComponent(panelText);
	panelText.setLayout(new BorderLayout(0, 0));
	
	textArea = new JTextArea();
	textArea.setText("<SAMLRaiderFailureInInitialization></SAMLRaiderFailureInInitialization>");
       scrollPane = new JScrollPane(textArea);
       scrollPane.add(textArea);
       panelText.add(scrollPane, BorderLayout.CENTER);
       scrollPane.setViewportView(textArea);
	
       this.invalidate();
       this.updateUI();
}
 
Example 8
Source File: MainView.java    From HiJson with Apache License 2.0 5 votes vote down vote up
private void changeLayout() {
    int selIndex = getTabIndex();
    if(selIndex < 0){
        return;
    }
    TabData selTabData = tabDataModel.getTab(selIndex);
    JSplitPane splitPane = (JSplitPane)selTabData.getComponent();
    if (splitPane.getOrientation() == JSplitPane.VERTICAL_SPLIT) {
        splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
        splitPane.setDividerLocation(0.45);
    } else {
        splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
        splitPane.setDividerLocation(0.45);
    }
}
 
Example 9
Source File: SectorRowsEditor.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    setLayout(new BorderLayout());
    this.setSize(new Dimension(441, 231));
    JSplitPane splitPane = new JSplitPane();
    this.add(splitPane, java.awt.BorderLayout.CENTER);
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPane.setDividerLocation(0.75d);
    splitPane.setLeftComponent(getSelectRowPane());
    splitPane.setRightComponent(getJPanel4());
}
 
Example 10
Source File: ResultWindow.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the layout orientation of the contained result pane.
 *
 * @param orientation the orientation (see {@link JSplitPane#VERTICAL_SPLIT}
 * and {@link JSplitPane#HORIZONTAL_SPLIT}) to set.
 */
public void setOrientation(int orientation) {
    for(JSplitPane view: viewMap.values()){
        if (view.getOrientation() != orientation) {
            view.setOrientation(orientation);
        }
    }
}
 
Example 11
Source File: PSheet.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JSplitPane createSplitPane(Component lower) {
    JSplitPane pane = new JSplitPane();

    if (firstSplit == null) {
        firstSplit = Boolean.TRUE;
    } else {
        firstSplit = Boolean.FALSE;
    }

    pane.setRightComponent(lower);
    pane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    pane.setContinuousLayout(true);
    pane.setResizeWeight(1);
    pane.setDividerLocation(0.80f);
    pane.setBorder(BorderFactory.createEmptyBorder());
    //Do not install our custom split pane UI on Nimbus L&F
    if (!"Nimbus".equals(UIManager.getLookAndFeel().getID())) {
        pane.setUI(PropUtils.createSplitPaneUI());
    }

    // #52188: default F6 behaviour doesn't make to much sense in NB 
    // property sheet and blocks NetBeans default F6
    pane.getActionMap().getParent().remove("toggleFocus");
    if( PropUtils.isAqua ) {
        pane.setBackground( UIManager.getColor("NbExplorerView.background") ); //NOI18N
    }

    return pane;
}
 
Example 12
Source File: SplitPaneOption.java    From JPPF with Apache License 2.0 5 votes vote down vote up
@Override
public void createUI() {
  final JSplitPane pane = new JSplitPane();
  pane.setOrientation(orientation == HORIZONTAL ? JSplitPane.HORIZONTAL_SPLIT : JSplitPane.VERTICAL_SPLIT);
  UIComponent = pane;
  children.add(FILLER1);
  children.add(FILLER2);
  pane.setLeftComponent(FILLER1.getUIComponent());
  pane.setRightComponent(FILLER2.getUIComponent());
  pane.setDividerSize(dividerWidth);
  pane.setResizeWeight(resizeWeight);
  pane.setOpaque(false);
}
 
Example 13
Source File: CreatePullRequestForm.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    createUIComponents();
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(9, 4, new Insets(0, 0, 0, 0), -1, -1));
    sourceBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(sourceBranchLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.SourceBranchLabel"));
    contentPanel.add(sourceBranchLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    titleLabel = new JLabel();
    this.$$$loadLabelText$$$(titleLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.TitleLabel"));
    contentPanel.add(titleLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    descriptionLabel = new JLabel();
    this.$$$loadLabelText$$$(descriptionLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.DescriptionLabel"));
    contentPanel.add(descriptionLabel, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    titleTextField = new JTextField();
    contentPanel.add(titleTextField, new GridConstraints(5, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    targetBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(targetBranchLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.TargetBranchLabel"));
    contentPanel.add(targetBranchLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    contentPanel.add(targetBranchDropdown, new GridConstraints(2, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    sourceBranch = new JLabel();
    sourceBranch.setText("");
    contentPanel.add(sourceBranch, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    splitPane = new JSplitPane();
    splitPane.setOrientation(0);
    contentPanel.add(splitPane, new GridConstraints(7, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));
    descriptionScrollPane = new JScrollPane();
    splitPane.setLeftComponent(descriptionScrollPane);
    descriptionTextArea = new JTextArea();
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setWrapStyleWord(true);
    descriptionScrollPane.setViewportView(descriptionTextArea);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    splitPane.setRightComponent(panel1);
    quickDiffPane = new JTabbedPane();
    panel1.add(quickDiffPane, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));
    spinnerPanel = new JPanel();
    spinnerPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    panel1.add(spinnerPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
    spinner = new BusySpinnerPanel();
    spinnerPanel.add(spinner);
    loadingLabel = new JLabel();
    this.$$$loadLabelText$$$(loadingLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.LoadingDiffLabel"));
    spinnerPanel.add(loadingLabel);
}
 
Example 14
Source File: LobbyFrame.java    From triplea with GNU General Public License v3.0 4 votes vote down vote up
public LobbyFrame(final LobbyClient lobbyClient, final ServerProperties serverProperties) {
  super("TripleA Lobby");
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  setIconImage(JFrameBuilder.getGameIcon());
  this.lobbyClient = lobbyClient;
  setJMenuBar(new LobbyMenu(this));
  chatTransmitter =
      new LobbyChatTransmitter(
          lobbyClient.getPlayerToLobbyConnection(), lobbyClient.getUserName());
  final Chat chat = new Chat(chatTransmitter);
  final ChatMessagePanel chatMessagePanel = new ChatMessagePanel(chat, ChatSoundProfile.LOBBY);
  chatMessagePanel.addServerMessage(serverProperties.getMessage());
  final ChatPlayerPanel chatPlayers = new ChatPlayerPanel(chat);
  chatPlayers.setPreferredSize(new Dimension(200, 600));
  chatPlayers.addActionFactory(this::lobbyPlayerRightClickMenuActions);

  tableModel =
      new LobbyGameTableModel(
          lobbyClient.isModerator(), lobbyClient.getPlayerToLobbyConnection());
  final LobbyGamePanel gamePanel =
      new LobbyGamePanel(this, lobbyClient, serverProperties.getUri(), tableModel);

  final JSplitPane leftSplit = new JSplitPane();
  leftSplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
  leftSplit.setTopComponent(gamePanel);
  leftSplit.setBottomComponent(chatMessagePanel);
  leftSplit.setResizeWeight(0.5);
  gamePanel.setPreferredSize(new Dimension(700, 200));
  chatMessagePanel.setPreferredSize(new Dimension(700, 400));
  final JSplitPane mainSplit = new JSplitPane();
  mainSplit.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  mainSplit.setLeftComponent(leftSplit);
  mainSplit.setRightComponent(chatPlayers);
  mainSplit.setResizeWeight(1);
  add(mainSplit, BorderLayout.CENTER);
  pack();
  chatMessagePanel.requestFocusInWindow();
  setLocationRelativeTo(null);
  lobbyClient
      .getPlayerToLobbyConnection()
      .addConnectionTerminatedListener(
          reason -> {
            DialogBuilder.builder()
                .parent(this)
                .title("Connection to Lobby Closed")
                .errorMessage("Connection closed: " + reason)
                .showDialog();
            shutdown();
          });
  lobbyClient.getPlayerToLobbyConnection().addConnectionClosedListener(this::shutdown);
  addWindowListener(
      new WindowAdapter() {
        @Override
        public void windowClosing(final WindowEvent e) {
          shutdown();
        }
      });
}
 
Example 15
Source File: MainPanel.java    From triplea with GNU General Public License v3.0 4 votes vote down vote up
/**
 * MainPanel is the full contents of the 'mainFrame'. This panel represents the welcome screen and
 * subsequent screens.
 */
MainPanel(
    final Runnable quitAction,
    final GameSelectorPanel gameSelectorPanel,
    final Consumer<MainPanel> launchAction,
    @Nullable final ChatModel chatModel,
    final Runnable cancelAction) {
  playButton.addActionListener(e -> launchAction.accept(this));
  cancelButton.addActionListener(e -> cancelAction.run());

  gameSelectorPanel.setBorder(new EtchedBorder());
  final JScrollPane gameSetupPanelScroll = new JScrollPane(gameSetupPanelHolder);
  gameSetupPanelScroll.setBorder(BorderFactory.createEmptyBorder());
  chatSplit = new JSplitPane();
  chatSplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
  chatSplit.setResizeWeight(0.8);
  chatSplit.setOneTouchExpandable(false);
  chatSplit.setDividerSize(5);

  mainPanel = new JPanelBuilder().border(0).gridBagLayout().build();
  mainPanel.add(
      gameSelectorPanel,
      new GridBagConstraintsBuilder(0, 0)
          .anchor(GridBagConstraintsAnchor.WEST)
          .fill(GridBagConstraintsFill.VERTICAL)
          .build());

  mainPanel.add(
      gameSetupPanelScroll,
      new GridBagConstraintsBuilder(1, 0)
          .anchor(GridBagConstraintsAnchor.CENTER)
          .fill(GridBagConstraintsFill.BOTH)
          .weightX(1.0)
          .weightY(1.0)
          .build());
  setLayout(new BorderLayout());

  if (chatModel instanceof ChatPanel) {
    addChat((ChatPanel) chatModel);
  } else {
    add(mainPanel, BorderLayout.CENTER);
  }

  final JButton quitButton =
      new JButtonBuilder()
          .title("Quit")
          .toolTip("Close TripleA.")
          .actionListener(quitAction)
          .build();
  final JPanel buttonsPanel =
      new JPanelBuilder().borderEtched().add(playButton).add(quitButton).build();
  add(buttonsPanel, BorderLayout.SOUTH);
  setPreferredSize(initialSize);
  updatePlayButtonState();
}
 
Example 16
Source File: RssGUI.java    From MtgDesktopCompanion with GNU General Public License v3.0 4 votes vote down vote up
public RssGUI() {
	

	model = new MagicNewsTableModel();
	table = new JXTable(model);
	tree = new JTree();
	JSplitPane splitNews = new JSplitPane();
	editorPane = MTGUIBrowserComponent.createBrowser();
	JSplitPane splitTreeTable = new JSplitPane();
	JPanel leftPanel = new JPanel();
	rootNode = new DefaultMutableTreeNode(MTGControler.getInstance().getLangService().getCapitalize("RSS_MODULE"));
	JPanel panelControl = new JPanel();
	btnNewButton = UITools.createBindableJButton(null,MTGConstants.ICON_NEW,KeyEvent.VK_N,"new news entry");
	btnSave = UITools.createBindableJButton(null,MTGConstants.ICON_SAVE,KeyEvent.VK_S,"save news entry");
	btnDelete =UITools.createBindableJButton(null,MTGConstants.ICON_DELETE,KeyEvent.VK_D,"delete news entry");
	lblLoading = AbstractBuzyIndicatorComponent.createLabelComponent();
	newsPanel = new NewsEditorPanel();
	
	setLayout(new BorderLayout(0, 0));
	tree.setPreferredSize(new Dimension(150, 64));
	splitNews.setOrientation(JSplitPane.VERTICAL_SPLIT);
	leftPanel.setLayout(new BorderLayout(0, 0));
	tree.setModel(new DefaultTreeModel(rootNode));
	tree.setCellRenderer(new NewsTreeCellRenderer());

	
	splitNews.setLeftComponent(new JScrollPane(table));
	splitNews.setRightComponent(new JScrollPane(editorPane));
	add(splitTreeTable, BorderLayout.CENTER);
	splitTreeTable.setRightComponent(splitNews);
	splitTreeTable.setLeftComponent(leftPanel);
	leftPanel.add(new JScrollPane(tree), BorderLayout.CENTER);
	
	leftPanel.add(panelControl, BorderLayout.NORTH);
	panelControl.add(btnNewButton);
	panelControl.add(btnSave);
	panelControl.add(btnDelete);
	panelControl.add(lblLoading);
	leftPanel.add(newsPanel, BorderLayout.SOUTH);
			

	initTree();

	initActions();


}
 
Example 17
Source File: AlarmGUI.java    From MtgDesktopCompanion with GNU General Public License v3.0 4 votes vote down vote up
public void initGUI() {
		splitPanel = new JSplitPane();

		table = new JXTable();
		model = new CardAlertTableModel();
		JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP);
		magicCardDetailPanel = new MagicCardDetailPanel();
		variationPanel = new HistoryPricesPanel(true);
		JPanel panelRight = new JPanel();
		resultListModel = new DefaultListModel<>();
		list = new JList<>(resultListModel);
		JPanel panel = new JPanel();
		btnRefresh = UITools.createBindableJButton(null, MTGConstants.ICON_REFRESH, KeyEvent.VK_R, "refresh Alarm");
		btnImport = UITools.createBindableJButton(null, MTGConstants.ICON_IMPORT, KeyEvent.VK_I, "import Alarm");
		btnDelete = UITools.createBindableJButton(null, MTGConstants.ICON_DELETE, KeyEvent.VK_D, "delete Alarm");
		btnSuggestPrice = UITools.createBindableJButton(null, MTGConstants.ICON_EURO, KeyEvent.VK_S, "suggestPrices Alarm");
		lblLoading = AbstractBuzyIndicatorComponent.createProgressComponent();
		JPanel serversPanel = new JPanel();
		ServerStatePanel oversightPanel = new ServerStatePanel(false,MTGControler.getInstance().getPlugin("Alert Trend Server", MTGServer.class));
		ServerStatePanel serverPricePanel = new ServerStatePanel(false,MTGControler.getInstance().getPlugin("Alert Price Checker", MTGServer.class));
		UITools.initTableFilter(table);

		
///////CONFIG		
		setLayout(new BorderLayout());
		splitPanel.setOrientation(JSplitPane.VERTICAL_SPLIT);
		table.setModel(model);
		table.getColumnModel().getColumn(3).setCellRenderer(new AlertedCardsRenderer());
		magicCardDetailPanel.enableThumbnail(true);
		list.setCellRenderer((JList<? extends MagicPrice> obj, MagicPrice value, int index, boolean isSelected,boolean cellHasFocus) -> new MagicPricePanel(value));
		table.getColumnModel().getColumn(4).setCellRenderer(new CardShakeRenderer());
		table.getColumnModel().getColumn(5).setCellRenderer(new CardShakeRenderer());
		table.getColumnModel().getColumn(6).setCellRenderer(new CardShakeRenderer());
		table.getColumnModel().getColumn(1).setCellRenderer(new MagicEditionsComboBoxCellRenderer(false));
		table.getColumnModel().getColumn(1).setCellEditor(new MagicEditionsComboBoxCellEditor());
		table.setRowHeight(MTGConstants.TABLE_ROW_HEIGHT);

		btnSuggestPrice.setToolTipText(MTGControler.getInstance().getLangService().getCapitalize("SUGGEST_PRICE"));
		
		panelRight.setLayout(new BorderLayout());
	
///////ADDS	
		splitPanel.setLeftComponent(new JScrollPane(table));
		add(splitPanel, BorderLayout.CENTER);
		splitPanel.setRightComponent(tabbedPane);
		
		serversPanel.setLayout(new GridLayout(2, 1, 0, 0));
		serversPanel.add(oversightPanel);
		serversPanel.add(serverPricePanel);
		panelRight.add(serversPanel,BorderLayout.SOUTH);
		tabbedPane.addTab(MTGControler.getInstance().getLangService().getCapitalize("DETAILS"), MTGConstants.ICON_TAB_DETAILS, magicCardDetailPanel, null);
		tabbedPane.addTab(MTGControler.getInstance().getLangService().getCapitalize("PRICE_VARIATIONS"), MTGConstants.ICON_TAB_VARIATIONS, variationPanel, null);
		pricesTablePanel = new PricesTablePanel();
		tabbedPane.addTab(MTGControler.getInstance().getLangService().getCapitalize("PRICES"), MTGConstants.ICON_TAB_PRICES, pricesTablePanel, null);
		add(panelRight, BorderLayout.EAST);
		panelRight.add(new JScrollPane(list),BorderLayout.CENTER);
		add(panel, BorderLayout.NORTH);
		panel.add(btnDelete);
		panel.add(btnImport);
		panel.add(btnRefresh);
		panel.add(btnSuggestPrice);
		panel.add(lblLoading);
		
	}
 
Example 18
Source File: MSMSLibrarySubmissionWindow.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create the frame.
 */
public MSMSLibrarySubmissionWindow() {
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  setBounds(100, 100, 854, 619);

  JPanel main = new JPanel(new BorderLayout());
  JSplitPane split = new JSplitPane();
  split.setOrientation(JSplitPane.VERTICAL_SPLIT);
  main.add(split);
  setContentPane(main);

  contentPane = new JPanel();
  contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  contentPane.setLayout(new BorderLayout(0, 0));
  split.setLeftComponent(contentPane);

  txtResults = new ResultsTextPane();
  txtResults.setEditable(false);
  JScrollPane scrollResults = new JScrollPane(txtResults);
  scrollResults.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  split.setRightComponent(scrollResults);
  split.setResizeWeight(0.92);


  // load parameter
  paramSubmit = (LibrarySubmitParameters) MZmineCore.getConfiguration()
      .getModuleParameters(LibrarySubmitModule.class);


  pnSideMenu = new JPanel();
  contentPane.add(pnSideMenu, BorderLayout.EAST);
  pnSideMenu.setLayout(new BorderLayout(0, 0));

  pnSettings = new JPanel();
  pnSideMenu.add(pnSettings, BorderLayout.NORTH);
  pnSettings.setLayout(new MigLayout("", "[][grow]", "[][][][][]"));

  lblSettings = new JLabel("Masslist selection and preprocessing");
  lblSettings.setFont(new Font("Tahoma", Font.BOLD, 11));
  pnSettings.add(lblSettings, "cell 0 0");

  // buttons
  pnButtons = new JPanel();
  pnSideMenu.add(pnButtons, BorderLayout.SOUTH);

  this.helpURL = paramSubmit.getClass().getResource("help/help.html");

  if (helpURL != null) {
    helpButton = GUIUtils.addButton(pnButtons, "Help", null, this);
  }

  JButton btnCheck = new JButton("Check");
  btnCheck.addActionListener(e -> {
    if (checkParameters())
      DialogLoggerUtil.showMessageDialogForTime(this, "Check OK", "All parameters are set", 1500);
  });
  pnButtons.add(btnCheck);

  JButton btnSubmit = new JButton("Submit");
  btnSubmit.addActionListener(e -> submitSpectra());
  pnButtons.add(btnSubmit);

  parametersAndComponents = new Hashtable<String, JComponent>();
  createSubmitParamPanel();
  createMetaDataPanel();

  // add listener
  addListener();


  scrollCharts = new JScrollPane();
  contentPane.add(scrollCharts, BorderLayout.CENTER);

  pnCharts = new JPanel();
  pnCharts.setLayout(new GridLayout(0, 1));
  scrollCharts.setViewportView(pnCharts);

  addMenu();
}
 
Example 19
Source File: MSMSLibrarySubmissionWindow.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create the frame.
 */
public MSMSLibrarySubmissionWindow() {
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
  setBounds(100, 100, 854, 619);

  JPanel main = new JPanel(new BorderLayout());
  JSplitPane split = new JSplitPane();
  split.setOrientation(JSplitPane.VERTICAL_SPLIT);
  main.add(split);
  setContentPane(main);

  contentPane = new JPanel();
  contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  contentPane.setLayout(new BorderLayout(0, 0));
  split.setLeftComponent(contentPane);

  txtResults = new ResultsTextPane();
  txtResults.setEditable(false);
  JScrollPane scrollResults = new JScrollPane(txtResults);
  scrollResults.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  split.setRightComponent(scrollResults);
  split.setResizeWeight(0.92);

  // load parameter
  paramSubmit = (LibrarySubmitParameters) MZmineCore.getConfiguration()
      .getModuleParameters(LibrarySubmitModule.class);

  pnSideMenu = new JPanel();
  contentPane.add(pnSideMenu, BorderLayout.EAST);
  pnSideMenu.setLayout(new BorderLayout(0, 0));

  pnSettings = new JPanel();
  pnSideMenu.add(pnSettings, BorderLayout.NORTH);
  pnSettings.setLayout(new MigLayout("", "[][grow]", "[][][][][]"));

  lblSettings = new JLabel("Masslist selection and preprocessing");
  lblSettings.setFont(new Font("Tahoma", Font.BOLD, 11));
  pnSettings.add(lblSettings, "cell 0 0");

  // buttons
  pnButtons = new JPanel();
  pnSideMenu.add(pnButtons, BorderLayout.SOUTH);

  this.helpURL = paramSubmit.getClass().getResource("help/help.html");

  if (helpURL != null) {
    helpButton = GUIUtils.addButton(pnButtons, "Help", null, this);
  }

  JButton btnCheck = new JButton("Check");
  btnCheck.addActionListener(e -> {
    if (checkParameters())
      DialogLoggerUtil.showMessageDialogForTime("Check OK", "All parameters are set", 1500);
  });
  pnButtons.add(btnCheck);

  JButton btnSubmit = new JButton("Submit");
  btnSubmit.addActionListener(e -> submitSpectra());
  pnButtons.add(btnSubmit);

  parametersAndComponents = new Hashtable<>();
  createSubmitParamPanel();
  createMetaDataPanel();

  // add listener
  addListener();

  scrollCharts = new JScrollPane();
  contentPane.add(scrollCharts, BorderLayout.CENTER);

  pnCharts = new JPanel();
  pnCharts.setLayout(new GridLayout(0, 1));
  scrollCharts.setViewportView(pnCharts);

  addMenu();
}