use of javax.swing.JTabbedPane in project Smack by igniterealtime.
the class EnhancedDebugger method createDebug.
/**
* Creates the debug process, which is a GUI window that displays XML traffic.
*/
private void createDebug() {
// We'll arrange the UI into six tabs. The first tab contains all data, the second
// client generated XML, the third server generated XML, the fourth allows to send
// ad-hoc messages and the fifth contains connection information.
tabbedPane = new JTabbedPane();
// Add the All Packets, Sent, Received and Interpreted panels
addBasicPanels();
// Add the panel to send ad-hoc messages
addAdhocPacketPanel();
// Add the connection information panel
addInformationPanel();
// Create a thread that will listen for all incoming packets and write them to
// the GUI. This is what we call "interpreted" packet data, since it's the packet
// data as Smack sees it and not as it's coming in as raw XML.
packetReaderListener = new StanzaListener() {
SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss:SS");
@Override
public void processStanza(final Stanza packet) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
addReadPacketToTable(dateFormatter, packet);
}
});
}
};
// Create a thread that will listen for all outgoing packets and write them to
// the GUI.
packetWriterListener = new StanzaListener() {
SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss:SS");
@Override
public void processStanza(final Stanza packet) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
addSentPacketToTable(dateFormatter, packet);
}
});
}
};
// Create a thread that will listen for any connection closed event
connListener = new AbstractConnectionListener() {
@Override
public void connectionClosed() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusField.setValue("Closed");
EnhancedDebuggerWindow.connectionClosed(EnhancedDebugger.this);
}
});
}
@Override
public void connectionClosedOnError(final Exception e) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusField.setValue("Closed due to an exception");
EnhancedDebuggerWindow.connectionClosedOnError(EnhancedDebugger.this, e);
}
});
}
@Override
public void reconnectingIn(final int seconds) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusField.setValue("Attempt to reconnect in " + seconds + " seconds");
}
});
}
@Override
public void reconnectionSuccessful() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusField.setValue("Reconnection stablished");
EnhancedDebuggerWindow.connectionEstablished(EnhancedDebugger.this);
}
});
}
@Override
public void reconnectionFailed(Exception e) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
statusField.setValue("Reconnection failed");
}
});
}
};
}
use of javax.swing.JTabbedPane in project pcgen by PCGen.
the class PreferencesPluginsPanel method addPluginPanes.
private void addPluginPanes(DefaultMutableTreeNode rootNode, DefaultMutableTreeNode pluginNode) {
if (pluginsPanel == null) {
pluginsPanel = new PreferencesPluginsPanel();
}
JTabbedPane tpane = new JTabbedPane();
tpane.add(pluginsPanel.toString(), pluginsPanel);
//$NON-NLS-1$
settingsPanel.add(tpane, LanguageBundle.getString("in_Prefs_plugins"));
rootNode.add(pluginNode);
}
use of javax.swing.JTabbedPane in project pcgen by PCGen.
the class MainAbout method initComponents.
/**
* This method is called from within the constructor to
* initialize the form.
*/
private void initComponents() {
JTabbedPane mainPane = new JTabbedPane();
//$NON-NLS-1$
mainPane.add(LanguageBundle.getString("in_abt_credits"), buildCreditsPanel());
//$NON-NLS-1$
mainPane.add(LanguageBundle.getString("in_abt_libraries"), buildIncludesPanel());
//$NON-NLS-1$
mainPane.add(LanguageBundle.getString("in_abt_license"), buildLicensePanel());
//$NON-NLS-1$
mainPane.add(LanguageBundle.getString("in_abt_awards"), buildAwardsPanel());
//$NON-NLS-1$
mainPane.add(LanguageBundle.getString("in_abt_sponsors"), buildSponsorsPanel());
setLayout(new BorderLayout());
add(mainPane, BorderLayout.CENTER);
mainPane.setPreferredSize(new Dimension(640, 480));
}
use of javax.swing.JTabbedPane in project pcgen by PCGen.
the class OverlandPlugin method toolMenuItem.
/**
* Sets the index for the pane
* @param evt
*/
private void toolMenuItem(ActionEvent evt) {
JTabbedPane tp = GMGenSystemView.getTabPane();
IntStream.range(0, tp.getTabCount()).filter(i -> tp.getComponentAt(i) instanceof OverPanel).forEach(tp::setSelectedIndex);
}
use of javax.swing.JTabbedPane in project ACS by ACS-Community.
the class RemoteResponseWindow method getResultPanel.
/**
* Return the ResultPanel property value.
* @return javax.swing.JTabbedPane
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTabbedPane getResultPanel() {
if (ivjResultPanel == null) {
try {
ivjResultPanel = new javax.swing.JTabbedPane();
ivjResultPanel.setName("ResultPanel");
ivjResultPanel.insertTab("Text output", null, getTextPanel(), null, 0);
ivjResultPanel.insertTab("Trend", null, getTrendPanel(), null, 1);
ivjResultPanel.insertTab("Operations", null, getOperations(), null, 2);
// set trend as default
ivjResultPanel.setSelectedIndex(1);
// text output switch
ivjResultPanel.addChangeListener(new ChangeListener() {
// This method is called whenever the selected tab changes
public void stateChanged(ChangeEvent evt) {
JTabbedPane pane = (JTabbedPane) evt.getSource();
// Get current tab
textOutputTabSelected = (pane.getSelectedIndex() == 0);
}
});
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjResultPanel;
}
Aggregations