use of java.awt.Dimension in project hackpad by dropbox.
the class RunProxy method enterInterruptImpl.
/**
* Handles script interruption.
*/
void enterInterruptImpl(Dim.StackFrame lastFrame, String threadTitle, String alertMessage) {
statusBar.setText("Thread: " + threadTitle);
showStopLine(lastFrame);
if (alertMessage != null) {
MessageDialogWrapper.showMessageDialog(this, alertMessage, "Exception in Script", JOptionPane.ERROR_MESSAGE);
}
updateEnabled(true);
Dim.ContextData contextData = lastFrame.contextData();
JComboBox ctx = context.context;
List<String> toolTips = context.toolTips;
context.disableUpdate();
int frameCount = contextData.frameCount();
ctx.removeAllItems();
// workaround for JDK 1.4 bug that caches selected value even after
// removeAllItems() is called
ctx.setSelectedItem(null);
toolTips.clear();
for (int i = 0; i < frameCount; i++) {
Dim.StackFrame frame = contextData.getFrame(i);
String url = frame.getUrl();
int lineNumber = frame.getLineNumber();
String shortName = url;
if (url.length() > 20) {
shortName = "..." + url.substring(url.length() - 17);
}
String location = "\"" + shortName + "\", line " + lineNumber;
ctx.insertItemAt(location, i);
location = "\"" + url + "\", line " + lineNumber;
toolTips.add(location);
}
context.enableUpdate();
ctx.setSelectedIndex(0);
ctx.setMinimumSize(new Dimension(50, ctx.getMinimumSize().height));
}
use of java.awt.Dimension in project pcgen by PCGen.
the class TableUtils method createToggleButtonSelectionPane.
private static JScrollPane createToggleButtonSelectionPane(JTable table, JTable rowheaderTable, JToggleButton button) {
rowheaderTable.setAutoCreateColumnsFromModel(false);
// force the tables to share models
rowheaderTable.setModel(table.getModel());
rowheaderTable.setSelectionModel(table.getSelectionModel());
rowheaderTable.setRowHeight(table.getRowHeight());
rowheaderTable.setIntercellSpacing(table.getIntercellSpacing());
rowheaderTable.setShowGrid(false);
rowheaderTable.setFocusable(false);
TableColumn column = new TableColumn(-1);
column.setHeaderValue(new Object());
column.setCellRenderer(new TableCellUtilities.ToggleButtonRenderer(button));
rowheaderTable.addColumn(column);
rowheaderTable.setPreferredScrollableViewportSize(new Dimension(20, 0));
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(table);
scrollPane.setRowHeaderView(rowheaderTable);
return scrollPane;
}
use of java.awt.Dimension in project pcgen by PCGen.
the class InfoGuidePane method initComponents.
private void initComponents() {
mainPanel = new JPanel();
mainPanel.setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null));
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
mainPanel.setPreferredSize(new Dimension(650, 450));
setOpaque(false);
JPanel sourcesPanel = new JPanel(new GridBagLayout());
GridBagConstraints gbc1 = new GridBagConstraints();
gbc1.anchor = GridBagConstraints.EAST;
GridBagConstraints gbc2 = new GridBagConstraints();
gbc2.gridwidth = GridBagConstraints.REMAINDER;
gbc2.fill = GridBagConstraints.BOTH;
sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_intro")), gbc2);
sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_gamemode")), gbc1);
sourcesPanel.add(gameModeLabel, gbc2);
sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_sources")), gbc1);
sourcesPanel.add(campaignList, gbc2);
JEditorPane guidePane = createHtmlPane();
guidePane.setText(LanguageBundle.getFormattedString("in_si_whatnext", Icons.New16.getImageIcon(), Icons.Open16.getImageIcon()));
mainPanel.add(sourcesPanel);
mainPanel.add(guidePane);
mainPanel.add(tipPane);
refreshDisplayedSources(null);
JPanel outerPanel = new JPanel(new FlowLayout());
outerPanel.add(mainPanel);
setLayout(new BorderLayout());
add(outerPanel, BorderLayout.CENTER);
tipPane.setText(LanguageBundle.getFormattedString("in_si_tip", TipOfTheDayHandler.getInstance().getNextTip()));
}
use of java.awt.Dimension in project pcgen by PCGen.
the class RaceInfoTab method initComponents.
private void initComponents() {
FlippingSplitPane topPane = new FlippingSplitPane("RaceTop");
setTopComponent(topPane);
setOrientation(VERTICAL_SPLIT);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<Object, RaceFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
noRacialHdFilterButton.setText(LanguageBundle.getString("in_irNoRacialHd"));
//$NON-NLS-1$
noRacialHdFilterButton.setToolTipText(LanguageBundle.getString("in_irNoRacialHdTip"));
bar.addDisplayableFilter(noRacialHdFilterButton);
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
bar.addDisplayableFilter(qFilterButton);
raceTable.setDisplayableFilter(bar);
availPanel.add(bar, BorderLayout.NORTH);
raceTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
raceTable.setTreeCellRenderer(qualifiedRenderer);
availPanel.add(new JScrollPane(raceTable), BorderLayout.CENTER);
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
selectRaceButton.setHorizontalTextPosition(SwingConstants.LEADING);
box.add(selectRaceButton);
box.add(Box.createHorizontalStrut(5));
box.setBorder(new EmptyBorder(0, 0, 5, 0));
availPanel.add(box, BorderLayout.SOUTH);
topPane.setLeftComponent(availPanel);
JPanel selPanel = new JPanel(new BorderLayout());
FilterBar<Object, RaceFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
selectedTable.setDisplayableFilter(filterBar);
selectedTable.setTreeCellRenderer(qualifiedRenderer);
JScrollPane scrollPane = new JScrollPane(selectedTable);
selPanel.add(scrollPane, BorderLayout.CENTER);
scrollPane.setPreferredSize(new Dimension(0, 0));
box = Box.createHorizontalBox();
box.add(Box.createHorizontalStrut(5));
box.add(removeButton);
box.add(Box.createHorizontalGlue());
box.setBorder(new EmptyBorder(0, 0, 5, 0));
selPanel.add(box, BorderLayout.SOUTH);
topPane.setRightComponent(selPanel);
topPane.setResizeWeight(0.75);
setBottomComponent(infoPane);
setResizeWeight(0.75);
}
use of java.awt.Dimension in project pcgen by PCGen.
the class SkillInfoTab method initComponents.
private void initComponents() {
setOrientation(VERTICAL_SPLIT);
setResizeWeight(0.70);
JSpinner spinner = new JSpinner();
//$NON-NLS-1$
spinner.setEditor(new JSpinner.NumberEditor(spinner, "#0.#"));
skillTable.setDefaultRenderer(Float.class, new SpinnerRenderer(spinner));
skillTable.setDefaultRenderer(Integer.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
skillTable.setDefaultRenderer(String.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
skillTable.setRowHeight(26);
FilterBar<CharacterFacade, SkillFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
cFilterButton.setText(LanguageBundle.getString("in_classString"));
cFilterButton.setEnabled(false);
filterBar.addDisplayableFilter(cFilterButton);
//$NON-NLS-1$
trainedFilterButton.setText(LanguageBundle.getString("in_trained"));
trainedFilterButton.setEnabled(false);
filterBar.addDisplayableFilter(trainedFilterButton);
JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(skillTable, filterBar);
availPanel.setPreferredSize(new Dimension(650, 300));
JScrollPane tableScrollPane;
JPanel tablePanel = new JPanel(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
constraints.fill = java.awt.GridBagConstraints.BOTH;
constraints.weightx = 1.0;
constraints.ipady = 0;
constraints.weighty = 1.0;
SkillPointTableModel.initializeTable(skillpointTable);
tableScrollPane = new JScrollPane(skillpointTable);
tablePanel.add(tableScrollPane, constraints);
htmlPane.setOpaque(false);
htmlPane.setEditable(false);
htmlPane.setFocusable(false);
//$NON-NLS-1$
htmlPane.setContentType("text/html");
skillFilterBox.setRenderer(new DefaultListCellRenderer());
JScrollPane selScrollPane = new JScrollPane(htmlPane);
JPanel skillPanel = new JPanel(new BorderLayout());
skillPanel.add(skillFilterBox, BorderLayout.NORTH);
skillPanel.add(selScrollPane, BorderLayout.CENTER);
selScrollPane.setPreferredSize(new Dimension(530, 300));
FlippingSplitPane topPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, availPanel, skillPanel, "SkillTop");
setTopComponent(topPane);
FlippingSplitPane bottomPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, "SkillBottom");
bottomPane.setLeftComponent(tablePanel);
tablePanel.setPreferredSize(new Dimension(650, 100));
bottomPane.setRightComponent(infoPane);
infoPane.setPreferredSize(new Dimension(530, 100));
setBottomComponent(bottomPane);
}
Aggregations