Skip to content

Commit

Permalink
Task #9 - Localization
Browse files Browse the repository at this point in the history
  • Loading branch information
likhachev committed Nov 26, 2015
1 parent 2ca0d49 commit 9f3beec
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/ivli/roim/controls/ChartView.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void initChart () {
iPlot = new XYPlot();
//plot.setDataset(xyc);
iPlot.setRenderer(new StandardXYItemRenderer());
iPlot.setDomainAxis(new NumberAxis("ROI_CHART.TIME_SERIES_VALUES"));
iPlot.setRangeAxis(0, new NumberAxis("ROI_CHART.ROI_INTDEN_VALUES"));
iPlot.setDomainAxis(new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("ROI_CHART.TIME_SERIES_VALUES")));
iPlot.setRangeAxis(0, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("ROI_CHART.ROI_INTDEN_VALUES")));
// if(iShowHistogram)
// plot.setRangeAxis(1, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.HISTOGRAM")));
iPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public class HistogramExtractor implements Extractor {
Shape iRoi;
public final XYSeries iHist = new XYSeries(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("HISTOGRAMEXTRACTOR.IHISTOGRAM"));
public final XYSeries iHist = new XYSeries(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("HISTOGRAMEXTRACTOR.IHISTOGRAM"));

public HistogramExtractor(Shape aRoi){iRoi = aRoi;}

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/ivli/roim/controls/VOILUTPanel.form
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
<ResourceString bundle="com/ivli/roim/controls/Bundle.properties" key="INVERTED" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBox1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="jRadioButton1">
<Properties>
Expand Down Expand Up @@ -127,6 +130,9 @@
<ResourceString bundle="com/ivli/roim/controls/Bundle.properties" key="LUT" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
Expand Down
32 changes: 25 additions & 7 deletions src/main/java/com/ivli/roim/controls/VOILUTPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public VOILUTPanel(LUTControl aP, ImageFrame aS) {
jCheckBox3.setEnabled(false);


XYSeries s = new XYSeries(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.VOI_LUT"));
XYSeries s = new XYSeries(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("VOILUTPANEL.VOI_LUT"));
XYSeriesCollection xyc = new XYSeriesCollection(aP.makeXYSeries(s));


Expand All @@ -54,10 +54,10 @@ public VOILUTPanel(LUTControl aP, ImageFrame aS) {
final XYPlot plot = new XYPlot();
plot.setDataset(xyc);
plot.setRenderer(new StandardXYItemRenderer());
plot.setDomainAxis(new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.IMAGE_VALUES")));
plot.setRangeAxis(0, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.DISPLAY_VALUES")));
plot.setDomainAxis(new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("VOILUTPANEL.IMAGE_VALUES")));
plot.setRangeAxis(0, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("VOILUTPANEL.DISPLAY_VALUES")));
if(iShowHistogram)
plot.setRangeAxis(1, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.HISTOGRAM")));
plot.setRangeAxis(1, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("VOILUTPANEL.HISTOGRAM")));
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
///NumberAxis rangeAxis = ;
Expand Down Expand Up @@ -109,8 +109,13 @@ private void initComponents() {
.addGap(0, 303, Short.MAX_VALUE)
);

java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle"); // NOI18N
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle"); // NOI18N
jCheckBox1.setText(bundle.getString("LUT_MODE.INVERTED")); // NOI18N
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});

buttonGroup1.add(jRadioButton1);
jRadioButton1.setText(bundle.getString("LUT_MODE.LINEAR")); // NOI18N
Expand All @@ -124,6 +129,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jRadioButton2.setText(bundle.getString("LUT_MODE.LOGARITHMIC")); // NOI18N

jButton1.setText(bundle.getString("LUT_PANEL.BUTTON_LUT")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(240, 240, 240)));

Expand All @@ -138,7 +148,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGap(0, 255, Short.MAX_VALUE)
);

jCheckBox3.setText(bundle.getString("SHOWHISTOGRAM")); // NOI18N
jCheckBox3.setText(bundle.getString("LUT_PANEL.SHOWHISTOGRAM")); // NOI18N
jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox3ActionPerformed(evt);
Expand Down Expand Up @@ -203,14 +213,22 @@ private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
hx.iHist.remove(0); ///correction for background
((XYSeriesCollection)iChart.getChart().getXYPlot().getDataset()).addSeries(hx.iHist);

iChart.getChart().getXYPlot().setRangeAxis(1, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("VOILUTPANEL.HISTOGRAM")));
iChart.getChart().getXYPlot().setRangeAxis(1, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/controls/Bundle").getString("VOILUTPANEL.HISTOGRAM")));
} else {
((XYSeriesCollection)iChart.getChart().getXYPlot().getDataset()).removeSeries(1);
iChart.getChart().getXYPlot().setRangeAxis(1, null);
}

}//GEN-LAST:event_jCheckBox3ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed

private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jCheckBox1ActionPerformed


// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1;
Expand Down
29 changes: 1 addition & 28 deletions src/main/resources/com/ivli/roim/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ MNU_ROI_OPERATIONS.ROTATE_90_CCW=Rotate 90\u00b0 CCW
MNU_ROI_OPERATIONS.CONVERT_TO_ISO=Convert To ISO level
MNU_ROI_OPERATIONS.DELETE_ALL=Delete All

CHOOSE\ A\ FILE=Choose a file

##VOILutPanel
LUT_MODE.INVERTED=Inverted
LUT_MODE.LINEAR=Linear
LUT_MODE.LOGARITHMIC=Logarithmic
LUT_PANEL.BUTTON_LUT=LUT
SHOWHISTOGRAM=ShowHistogramm
VOILUTPANEL.VOI_LUT=VOI LUT
VOILUTPANEL.HISTOGRAM=HISTOGRAM
LUT_PANEL.SHOWHISTOGRAM=ShowHistogramm
VOILUTPANEL.VOI_LUT=VOI LUT
VOILUTPANEL.HISTOGRAM=HISTOGRAM

IMAGE\ VALUES=Image values
DISPLAY\ VALUES=Display values
Expand Down Expand Up @@ -63,18 +50,6 @@ NOT\ SUPPORTED\ YET=Not supported yet
INVERT=invert
MOVE\ OVERLAY\ {0}=move Overlay {0}


HISTOGRAMEXTRACTOR.IHISTOGRAM=IHISTOGRAM
VOILUTPANEL.IMAGE_VALUES=IMAGE_VALUES
VOILUTPANEL.DISPLAY_VALUES=IMAGE_VALUES
LUT_MENU.CHOOSE_LUT_FILE=Choose LUT file
WL_CONTEXT_MENU_TITLE=WL_CONTEXT_MENU_TITLE

LUT_MENU.TRIGGER_LOGARITHMIC=LOGARITHMIC
LUT_MENU.TRIGGER_DIRECT_INVERSE=INVERSE
LUT_MENU.OPEN_BUILTIN_LUT=OPEN_BUILTIN_LUT
LUT_MENU.SHOW_DIALOG=SHOW_DIALOG
LUT_MENU.CHOOSE_LUT_FILE=Open LUT file
LUT_BUILTIN_TYPE_FIRE=FIRE
LUT_BUILTIN_TYPE_GRAYS=GRAYS
LUT_BUILTIN_TYPE_ICE=ICE
Expand All @@ -87,13 +62,11 @@ LUT_BUILTIN_TYPE_CYAN=CYAN
LUT_BUILTIN_TYPE_MAGENTA=MAGENTA
LUT_BUILTIN_TYPE_YELLOW=YELLOW
LUT_BUILTIN_TYPE_REDGREEN=REDGREEN
###LUT_MENU.OPEN_LUT_ONDISC=OPEN ON DISC


#com.ivli.roim.NewJFrame
VOI_LUT=VOI LUT
Fit_Width=Fit Width

LUT_MENU.CHOOSE_LUT_FILE=LUT_MENU.CHOOSE_LUT_FILE
NewJFrame.jPanel1.TabConstraints.tabTitle=ROI_PAGE
NewJFrame.jPanel3.TabConstraints.tabTitle=CHART_PAGE

Expand Down
15 changes: 14 additions & 1 deletion src/main/resources/com/ivli/roim/controls/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,17 @@ LUT_MENU.TRIGGER_LOGARITHMIC=LOGARITHMIC
LUT_MENU.CHOOSE_LUT_FILE=CHOOSE_LUT_FILE
LUT_MENU.OPEN_BUILTIN_LUT=OPEN_BUILTIN_LUT
LUT_MENU.SHOW_DIALOG=SHOW_DIALOG
LUT_MENU.TRIGGER_DIRECT_INVERSE=TRIGGER_DIRECT_INVERSE
LUT_MENU.TRIGGER_DIRECT_INVERSEINVERSE
ROI_CHART.TIME_SERIES_VALUES=TIME
ROI_CHART.ROI_INTDEN_VALUES=DENSITY
VOILUTPANEL.VOI_LUT=LUT
VOILUTPANEL.HISTOGRAM=IMAGE
VOILUTPANEL.DISPLAY_VALUES=DISPLAY_VALUES
VOILUTPANEL.IMAGE_VALUES=IMAGE_VALUES
LUT_MODE.INVERTED=INVERTED
LUT_MODE.LINEAR=LINEAR
LUT_MODE.LOGARITHMIC=LOGARITHMIC
LUT_PANEL.BUTTON_LUT=LUT
LUT_PANEL.SHOWHISTOGRAM=HISTOGRAM
HISTOGRAMEXTRACTOR.IHISTOGRAM=HISTOGRAM

0 comments on commit 9f3beec

Please sign in to comment.