Skip to content

Commit

Permalink
remove EditTab configurability
Browse files Browse the repository at this point in the history
  • Loading branch information
bdionne committed Dec 2, 2024
1 parent 44ac9a8 commit 734fad4
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 2,347 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>gov.nih.nci</groupId>
<artifactId>nci-edit-tab</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<name>Edit Tab</name>
<description>An editing tab for NCI's complex editing operations</description>
<packaging>bundle</packaging>
Expand Down
64 changes: 32 additions & 32 deletions src/main/java/gov/nih/nci/ui/ComplexEditPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,26 +254,26 @@ private JPanel createRadioButtonPanel() {
radioButtonPanel = new JPanel();
radioButtonGroup = new ButtonGroup();

if(NCIEditTabPreferences.getFnSplit()) {
//if(NCIEditTabPreferences.getFnSplit()) {
//splitButton = new JRadioButton("Split");
radioButtonGroup.add(splitButton);
radioButtonPanel.add(splitButton);
}
if(NCIEditTabPreferences.getFnCopy()) {
//}
//if(NCIEditTabPreferences.getFnCopy()) {
//cloneButton = new JRadioButton("Copy");
radioButtonGroup.add(cloneButton);
radioButtonPanel.add(cloneButton);
}
if(NCIEditTabPreferences.getFnMerge()) {
//}
//if(NCIEditTabPreferences.getFnMerge()) {
//mergeButton = new JRadioButton("Merge");
radioButtonGroup.add(mergeButton);
radioButtonPanel.add(mergeButton);
}
if(NCIEditTabPreferences.getFnDualEdits()) {
//}
//if(NCIEditTabPreferences.getFnDualEdits()) {
//dualButton = new JRadioButton("Dual Edits");
radioButtonGroup.add(dualButton);
radioButtonPanel.add(dualButton);
}
//}

ActionListener cbl = new ActionListener() {

Expand Down Expand Up @@ -324,42 +324,42 @@ public void actionPerformed(ActionEvent e) {

public void setRadioButtons() {
radioButtonGroup.clearSelection();
if(NCIEditTabPreferences.getFnSplit()) {
//if(NCIEditTabPreferences.getFnSplit()) {
radioButtonGroup.add(splitButton);
radioButtonPanel.add(splitButton);
splitButton.setEnabled(true);
} else {
splitButton.setEnabled(false);
radioButtonGroup.remove(splitButton);
radioButtonPanel.remove(splitButton);
}
if(NCIEditTabPreferences.getFnCopy()) {
//} else {
//splitButton.setEnabled(false);
//radioButtonGroup.remove(splitButton);
//radioButtonPanel.remove(splitButton);
//}
//if(NCIEditTabPreferences.getFnCopy()) {
radioButtonGroup.add(cloneButton);
radioButtonPanel.add(cloneButton);
cloneButton.setEnabled(true);
} else {
cloneButton.setEnabled(false);
radioButtonGroup.remove(cloneButton);
radioButtonPanel.remove(cloneButton);
}
if(NCIEditTabPreferences.getFnMerge()) {
//} else {
//cloneButton.setEnabled(false);
//radioButtonGroup.remove(cloneButton);
//radioButtonPanel.remove(cloneButton);
//}
//if(NCIEditTabPreferences.getFnMerge()) {
radioButtonGroup.add(mergeButton);
radioButtonPanel.add(mergeButton);
mergeButton.setEnabled(true);
} else {
mergeButton.setEnabled(false);
radioButtonGroup.remove(mergeButton);
radioButtonPanel.remove(mergeButton);
}
if(NCIEditTabPreferences.getFnDualEdits()) {
//} else {
//mergeButton.setEnabled(false);
//radioButtonGroup.remove(mergeButton);
//radioButtonPanel.remove(mergeButton);
//}
//if(NCIEditTabPreferences.getFnDualEdits()) {
radioButtonGroup.add(dualButton);
radioButtonPanel.add(dualButton);
dualButton.setEnabled(true);
} else {
dualButton.setEnabled(false);
radioButtonGroup.remove(dualButton);
radioButtonPanel.remove(dualButton);
}
//} else {
//dualButton.setEnabled(false);
//radioButtonGroup.remove(dualButton);
//radioButtonPanel.remove(dualButton);
//}
}

public boolean isSplitBtnSelected() {
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/gov/nih/nci/ui/NCIComplexEditViewComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import gov.nih.nci.ui.event.ComplexEditType;
import gov.nih.nci.ui.event.EditTabChangeEvent;
import gov.nih.nci.ui.event.EditTabChangeListener;
import gov.nih.nci.ui.event.PreferencesChangeEvent;
import gov.nih.nci.ui.event.PreferencesChangeListener;
//import gov.nih.nci.ui.event.PreferencesChangeEvent;
//import gov.nih.nci.ui.event.PreferencesChangeListener;

public class NCIComplexEditViewComponent extends OWLClassAnnotationsViewComponent implements EditTabChangeListener, PreferencesChangeListener {
public class NCIComplexEditViewComponent extends OWLClassAnnotationsViewComponent implements EditTabChangeListener{

private static final long serialVersionUID = 1L;
private ComplexEditPanel complexEditPanel;
Expand All @@ -26,7 +26,7 @@ public void initialiseClassView() throws Exception {
setLayout(new BorderLayout());
add(complexEditPanel);
NCIEditTab.addListener(this);
NCIEditTab.addPrefListener(this);
//NCIEditTab.addPrefListener(this);

}

Expand Down Expand Up @@ -100,10 +100,12 @@ private OWLClass getOpTarget() {
return NCIEditTab.currentTab().getCurrentOp().getTarget();
}

/**
@Override
public void handleChange(PreferencesChangeEvent event) {
if (event.isType(ComplexEditType.PREFMODIFY)) {
complexEditPanel.setRadioButtons();
}
}
}
**/
}
7 changes: 4 additions & 3 deletions src/main/java/gov/nih/nci/ui/NCIEditTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
import gov.nih.nci.ui.event.ComplexEditType;
import gov.nih.nci.ui.event.EditTabChangeEvent;
import gov.nih.nci.ui.event.EditTabChangeListener;
import gov.nih.nci.ui.event.PreferencesChangeEvent;
import gov.nih.nci.ui.event.PreferencesChangeListener;
//import gov.nih.nci.ui.event.PreferencesChangeEvent;
//import gov.nih.nci.ui.event.PreferencesChangeListener;
import gov.nih.nci.utils.CharMapper;
import gov.nih.nci.utils.CuratorChecks;
import gov.nih.nci.utils.NCIClassSearcher;
Expand Down Expand Up @@ -437,7 +437,7 @@ public void fireChange(EditTabChangeEvent ev) {
l.handleChange(ev);
}
}

/**
private static ArrayList<PreferencesChangeListener> Prefevent_listeners = new ArrayList<PreferencesChangeListener>();
public static void addPrefListener(PreferencesChangeListener l) {
Expand All @@ -452,6 +452,7 @@ public void fireChange(PreferencesChangeEvent ev) {
l.handleChange(ev);
}
}
**/

private List<OWLAnnotationProperty> complex_properties = new ArrayList<OWLAnnotationProperty>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public NCIEditTabOwlEntityListCellRenderer(@Nonnull OWLEditorKit editorKit,
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component label = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if(value instanceof NCIEditTabPreferencesPanel.OwlEntityListItem) {
OWLEntity entity = ((NCIEditTabPreferencesPanel.OwlEntityListItem) value).getEntity();
label = owlCellRenderer.getListCellRendererComponent(list, entity, index, isSelected, cellHasFocus);
}
//if(value instanceof NCIEditTabPreferencesPanel.OwlEntityListItem) {
//OWLEntity entity = ((NCIEditTabPreferencesPanel.OwlEntityListItem) value).getEntity();
//label = owlCellRenderer.getListCellRendererComponent(list, entity, index, isSelected, cellHasFocus);
//}
return label;
}
}
Loading

0 comments on commit 734fad4

Please sign in to comment.