@Override protected void initLocale(Locale locale) { super.initLocale(locale); urlLabel.setText(ConsoleLocale.getString("url", locale)); }
@SuppressWarnings("unchecked") @Override protected void initEditorPanelLayout() { urlLabel = new JBasicLabel(); urlLabel.setFont(new Font(FontContext.getFontName(), FONT_STYLE, FONT_SIZE));
protected JBasicLabel createTitleLabel() { if (titleLabel == null) { titleLabel = new JBasicLabel(); } return titleLabel; }
private JBasicLabel createTitleLabel() { if (titleLabel == null) { titleLabel = new JBasicLabel(); } return titleLabel; }
@SuppressWarnings("unchecked") @Override protected void initEditorPanelLayout() { registryCenterLabel = new JBasicLabel(); registryCenterLabel.setFont(new Font(FontContext.getFontName(), FONT_STYLE, FONT_SIZE)); accountLabel.setFont(new Font(FontContext.getFontName(), FONT_STYLE, FONT_SIZE));
@Override protected void initLocale(Locale locale) { super.initLocale(locale); registryCenterLabel.setText(ConsoleLocale.getString("registry", locale)); }
groupPanel.setLayout(tableLayout); groupPanel.setBorder(UIFactory.createTitledBorder(ConsoleLocale.getString("group_layout"))); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); groupPanel.add(groupStartXTextField, "1, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); groupPanel.add(groupStartYTextField, "3, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); groupPanel.add(groupHorizontalGapTextField, "1, 1"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); groupPanel.add(groupVerticalGapTextField, "3, 1"); nodePanel.setLayout(tableLayout); nodePanel.setBorder(UIFactory.createTitledBorder(ConsoleLocale.getString("node_layout"))); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); nodePanel.add(nodeStartXTextField, "1, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); nodePanel.add(nodeStartYTextField, "3, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); nodePanel.add(nodeHorizontalGapTextField, "1, 1"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); nodePanel.add(nodeVerticalGapTextField, "3, 1");
@Override public void executeSelection(TreeNode oldSelectionTreeNode, TreeNode newSelectionTreeNode) { container.removeAll(); if (newSelectionTreeNode != null && newSelectionTreeNode.isLeaf() && newSelectionTreeNode.getParent() != getModel().getRoot()) { container.add(createConfigContainer(), BorderLayout.CENTER); configTreeNodeSelection((ElementNode) newSelectionTreeNode); if (applicationEntity != null && titleLabel != null) { titleLabel.setText(ConsoleLocale.getString("application") + " [" + applicationEntity.getApplication() + "] " + ConsoleLocale.getString("group") + " [" + applicationEntity.getGroup() + "]"); } } else { container.add(blankPane, BorderLayout.CENTER); } ContainerManager.update(container); } };
@SuppressWarnings("unchecked") private JPanel createMethodListPane() { if (methodListPane == null) { interfaceLabel = new JBasicLabel(); methodList = new JBasicList(); methodList.setFixedCellHeight(28);
@Override public void executeSelection(int oldSelectedRow, int newSelectedRow) { container.removeAll(); if (newSelectedRow != -1) { ElementNode userEntityNode = (ElementNode) userList.getModel().getElementAt(newSelectedRow); UserEntity userEntity = (UserEntity) userEntityNode.getUserObject(); try { userEntity = UserController.getUser(userEntity.getName()); } catch (Exception e) { ExceptionTracer.traceException(HandleManager.getFrame(this), ConsoleLocale.getString("get_user_info_exception"), e); return; } container.add(createUserPropertyContainer(), BorderLayout.CENTER); userPropertyPane.setUser(userEntity); if (titleLabel != null) { UserType type = userEntity.getType(); String typeName = UserController.getUserTypeName(type); titleLabel.setText(typeName); } } else { container.add(blankPane, BorderLayout.CENTER); } ContainerManager.update(container); } };
clusterGroupPanel.setLayout(tableLayout); clusterGroupPanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("application_cluster") + " - " + ConsoleLocale.getString("group_layout"))); clusterGroupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); clusterGroupPanel.add(clusterGroupStartXTextField, "1, 0"); clusterGroupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); clusterGroupPanel.add(clusterGroupStartYTextField, "3, 0"); clusterGroupPanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); clusterGroupPanel.add(clusterGroupHorizontalGapTextField, "1, 1"); clusterGroupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); clusterGroupPanel.add(clusterGroupVerticalGapTextField, "3, 1"); groupPanel.setLayout(tableLayout); groupPanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("third_party_cluster") + " - " + ConsoleLocale.getString("group_layout"))); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); groupPanel.add(groupStartXTextField, "1, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); groupPanel.add(groupStartYTextField, "3, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); groupPanel.add(groupHorizontalGapTextField, "1, 1"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); groupPanel.add(groupVerticalGapTextField, "3, 1"); nodePanel.setLayout(tableLayout); nodePanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("node_layout"))); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); nodePanel.add(nodeStartXTextField, "1, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); nodePanel.add(nodeStartYTextField, "3, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1");
@SuppressWarnings("unchecked") public void execute(ActionEvent e) { if (serviceSummaryTable.getSelectedRowCount() > 1 || serviceSummaryTable.getSelectedRow() < 0) { JBasicOptionPane.showMessageDialog(HandleManager.getFrame(DeploySummaryWorkspace.this), ConsoleLocale.getString("interface_not_selection"), SwingLocale.getString("warning"), JBasicOptionPane.WARNING_MESSAGE); return; } JPanel methodListPane = createMethodListPane(); BasicTableModel tableModel = (BasicTableModel) serviceSummaryTable.getModel(); SummaryEntity summaryEntity = (SummaryEntity) tableModel.getRow(serviceSummaryTable.getSelectedRow()); interfaceLabel.setText(ConsoleLocale.getString("table_interface") + " : " + summaryEntity.getInterface()); List<String> methods = summaryEntity.getMethods(); if (CollectionUtils.isEmpty(methods)) { JBasicOptionPane.showMessageDialog(HandleManager.getFrame(DeploySummaryWorkspace.this), ConsoleLocale.getString("interface_not_injection"), SwingLocale.getString("warning"), JBasicOptionPane.WARNING_MESSAGE); return; } methodList.setModel(new BasicListModel(new Vector<String>(methods))); JBasicOptionPane.showOptionDialog(HandleManager.getFrame(DeploySummaryWorkspace.this), methodListPane, ConsoleLocale.getString("method_list_title"), JBasicOptionPane.DEFAULT_OPTION, JBasicOptionPane.PLAIN_MESSAGE, ConsoleIconFactory.getSwingIcon("banner/net.png"), new Object[] { SwingLocale.getString("close") }, null, true); } };
groupPanel.setLayout(tableLayout); groupPanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("group_layout"))); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); groupPanel.add(groupStartXTextField, "1, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); groupPanel.add(groupStartYTextField, "3, 0"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); groupPanel.add(groupHorizontalGapTextField, "1, 1"); groupPanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); groupPanel.add(groupVerticalGapTextField, "3, 1"); nodePanel.setLayout(tableLayout); nodePanel.setBorder(UIUtil.createTitledBorder(ConsoleLocale.getString("node_layout"))); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_x")), "0, 0"); nodePanel.add(nodeStartXTextField, "1, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("start_y")), "2, 0"); nodePanel.add(nodeStartYTextField, "3, 0"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("horizontal_gap")), "0, 1"); nodePanel.add(nodeHorizontalGapTextField, "1, 1"); nodePanel.add(new JBasicLabel(ConsoleLocale.getString("vertical_gap")), "2, 1"); nodePanel.add(nodeVerticalGapTextField, "3, 1");
private JPanel createLoggerFilePane() { if (loggerFilePane == null) { filePathTextField = new JBasicTextField(); filePathTextField.setText(PropertiesContext.getLoggerFilePath()); JClassicButton selectorButton = new JClassicButton(ConsoleIconFactory.getSwingIcon("stereo/import_16.png"), ConsoleLocale.getString("open_logger_file")); selectorButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFileSelector fileSelector = new JFileSelector(HandleManager.getFrame(TraceTopology.this), ConsoleLocale.getString("open_logger_file")); File file = fileSelector.openFile(); if (file != null) { filePathTextField.setText(file.getAbsolutePath()); } } }); double[][] size = { { 120, TableLayout.FILL, TableLayout.PREFERRED }, { TableLayout.PREFERRED } }; TableLayout tableLayout = new TableLayout(size); tableLayout.setVGap(5); loggerFilePane = new JPanel(); loggerFilePane.setLayout(tableLayout); loggerFilePane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0), UIUtil.createTitledBorder(""))); loggerFilePane.add(new JBasicLabel(ConsoleLocale.getString("logger_file_path")), "0, 0"); loggerFilePane.add(filePathTextField, "1, 0"); loggerFilePane.add(selectorButton, "2, 0"); } return loggerFilePane; }
public ConfigPane(String labelText, String hintText) { label = new JBasicLabel(labelText); textField = new JBasicTextField(); saveButton = new JClassicButton(createSaveAction()); hintLabel = new JBasicLabel(hintText, ConsoleIconFactory.getSwingIcon("question_message.png"), SwingConstants.LEADING); double[][] size = { { 100, TableLayout.FILL, TableLayout.PREFERRED }, { TableLayout.PREFERRED, TableLayout.PREFERRED } }; TableLayout tableLayout = new TableLayout(size); tableLayout.setHGap(0); tableLayout.setVGap(5); setLayout(tableLayout); add(label, "0, 0"); add(textField, "1, 0"); add(saveButton, "2, 0"); add(hintLabel, "1, 1, 2, 1"); }
private void initializeToolBar() { traceIdTextField = new JBasicTextField(); traceIdTextField.setPreferredSize(new Dimension(200, traceIdTextField.getPreferredSize().height)); boolean loggerTabSelection = PropertiesContext.isLoggerTabSelection(); if (loggerTabSelection) { String loggerTraceId = PropertiesContext.getLoggerTraceId(); traceIdTextField.setText(loggerTraceId); } JToolBar toolBar = getGraph().getToolbar(); toolBar.addSeparator(); toolBar.add(new JClassicButton(createConfigDataSourceAction())); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(new JBasicLabel("Trace ID :")); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(traceIdTextField); toolBar.add(new JClassicButton(createShowTopologyAction())); toolBar.add(new JClassicButton(createShowTableAction())); toolBar.add(new JClassicButton(createShowInfoAction())); toolBar.add(new JClassicButton(createShowSchematicAction())); toolBar.addSeparator(); toolBar.add(createConfigButton(false)); ButtonManager.updateUI(toolBar); setGroupAutoExpand(true); }
@SuppressWarnings("unchecked") public UserPropertyPane() { typeComboBox = new JBasicComboBox(); typeComboBox.setRenderer(new ElementComboBoxCellRenderer()); operationCheckBoxListPanel.getList().setSelectionForeground(Color.white); double[][] size = { { TableLayout.PREFERRED, TableLayout.FILL }, { TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED } }; TableLayout tableLayout = new TableLayout(size); tableLayout.setHGap(5); tableLayout.setVGap(5); setLayout(tableLayout); add(new JBasicLabel(SwingLocale.getString("account")), "0, 0"); add(nameTextField, "1, 0"); add(new JBasicLabel(SwingLocale.getString("password")), "0, 1"); add(passwordTextField, "1, 1"); add(new JBasicLabel(ConsoleLocale.getString("type")), "0, 2"); add(typeComboBox, "1, 2"); add(new JBasicLabel(ConsoleLocale.getString("operation")), "0, 3"); add(operationCheckBoxListPanel, "1, 3"); setPreferredSize(new Dimension(300, getPreferredSize().height)); }
@SuppressWarnings("unchecked") public ConfigComboBoxPane(String labelText) { label = new JBasicLabel(labelText); comboBox = new JBasicComboBox(); comboBox.setRenderer(new ElementComboBoxCellRenderer()); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ElementNode elementNode = (ElementNode) comboBox.getSelectedItem(); itemSelection(elementNode); } }); double[][] size = { { 100, TableLayout.FILL }, { TableLayout.PREFERRED } }; TableLayout tableLayout = new TableLayout(size); tableLayout.setHGap(0); tableLayout.setVGap(5); setLayout(tableLayout); add(label, "0, 0"); add(comboBox, "1, 0"); }
toolBar.addSeparator(); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(new JBasicLabel(ConsoleLocale.getString("application"))); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(configDropDownSelector); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(new JBasicLabel(ConsoleLocale.getString("table_protocol"))); toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(protocolComboBox);
public AutoRefreshPane() { autoRefreshCheckBox = new JBasicCheckBox(ConsoleLocale.getString("auto_refresh_topology"), ConsoleLocale.getString("auto_refresh_topology"), false); ElementNode[] nodes = TopologyController.getTimerNodes(); DefaultComboBoxModel<ElementNode> comboBoxModel = new DefaultComboBoxModel<ElementNode>(nodes); autoRefreshComboBox = new JBasicComboBox(); autoRefreshComboBox.setRenderer(new ElementComboBoxCellRenderer()); autoRefreshComboBox.setModel(comboBoxModel); autoRefreshComboBox.setSelectedIndex(1); double[][] size = { { TableLayout.PREFERRED, TableLayout.FILL }, { TableLayout.PREFERRED, TableLayout.PREFERRED } }; TableLayout tableLayout = new TableLayout(size); tableLayout.setHGap(5); tableLayout.setVGap(5); setPreferredSize(new Dimension(180, 60)); setLayout(tableLayout); add(autoRefreshCheckBox, "0, 0, 1, 0"); add(new JBasicLabel(ConsoleLocale.getString("auto_refresh_interval")), "0, 1"); add(autoRefreshComboBox, "1, 1"); autoRefreshTimer = new AutoRefreshTimer(); autoRefresh(); } }