Skip to content

Commit

Permalink
Namegenerator: Number of max. allowed alteri: calculation changed,
Browse files Browse the repository at this point in the history
Nameinterpreter: radiobox table scrolling problem fixed
  • Loading branch information
michael committed Nov 29, 2018
1 parent 61272cf commit 9ae61f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,19 @@ public boolean shouldBeSkipped()
private void updateNumberActorsText()
{
if (this.numberOfAllActors >= 0)
{
String textWarning = "";
int maxActors = (Integer) maxActorSpinner.getValue();
if ((maxActors > 0 ) && (this.numberOfAllActors > maxActors))
{
textWarning = "!";
}

numberAllActors.setText(""
+ Messages.getString("NameGenerator.Alteri") + ": "
+ this.numberOfAllActors);
+ (this.numberOfAllActors + alreadyNamedListModel.size() )
+ " ("+this.numberOfAllActors+textWarning+")");
}
/*
* if ((this.numberOfAllActors > VennMaker.getInstance().getProject()
* .getMaxNumberActors()) &&
Expand Down
23 changes: 14 additions & 9 deletions src/main/java/interview/panels/multi/RadioAnswerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import javax.swing.ButtonModel;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
Expand Down Expand Up @@ -108,12 +109,13 @@ private void buildRightPanel()
RadioTableModel radioTableModel = new RadioTableModel(actors, aType,
answers);
radioTable = new JTable(radioTableModel);
radioTable.setDefaultRenderer(JRadioButton.class, new ComponentRenderer(
this));
radioTable.setDefaultEditor(JRadioButton.class, new RadioButtonEditor(
new JCheckBox()));
radioTable.setDefaultRenderer(JRadioButton.class, new ComponentRenderer(this));
radioTable.setDefaultEditor(JRadioButton.class, new RadioButtonEditor(new JCheckBox()));

WordWrapHeaderRenderer headerRenderer = new WordWrapHeaderRenderer(this);
radioTable.getTableHeader().setDefaultRenderer(headerRenderer);
radioTable.setRowHeight((int) (VennMakerUIConfig.getFontSize()+15));

JScrollPane rightScroll = new JScrollPane(radioTable);

rightPanel.add(radioTable.getTableHeader(), BorderLayout.NORTH);
Expand All @@ -133,6 +135,7 @@ private void buildLeftPanel()
actorTable.setDefaultRenderer(JLabel.class, new ComponentRenderer(this));
actorTable.getTableHeader().setDefaultRenderer(
new WordWrapHeaderRenderer(this));
actorTable.setRowHeight((int) (VennMakerUIConfig.getFontSize()+15));
leftPanel = new JPanel(new BorderLayout());
JScrollPane leftScroll = new JScrollPane(actorTable);
leftPanel.add(actorTable.getTableHeader(), BorderLayout.NORTH);
Expand Down Expand Up @@ -174,16 +177,16 @@ public boolean performChanges()
for (Akteur a : actors)
{
ButtonModel bm = answers.get(a).getSelection();
if (bm == null)
if (bm == null) {
return false;
}
String value = bm.getActionCommand();
hm.put(a, value);
a.setAttributeValue(aType, n, value);

}
oldAttributeValues.put(n, hm);
}

return true;
}

Expand Down Expand Up @@ -400,8 +403,8 @@ public Component getTableCellRendererComponent(JTable table, Object value,
((Component) value).setBackground(new Color(0xffbab0));


table.setRowHeight(row, (int) (VennMakerUIConfig.getFontSize()+5));
// table.setRowHeight(row, (int) (VennMakerUIConfig.getFontSize()+5));

return (Component) value;
}
}
Expand Down Expand Up @@ -502,8 +505,10 @@ public RadioTableModel(List<Akteur> actors, AttributeType aType,
rb.setSelected(true);
}
}
if (answer == null)
if (answer == null) {
answers.put(a, null);
}

data.put(a, bg);
}
}
Expand Down

0 comments on commit 9ae61f1

Please sign in to comment.