From 8b11fabf3de54c1228fb3f07a6ac554048ae7230 Mon Sep 17 00:00:00 2001 From: denny Date: Sat, 5 Mar 2016 08:23:08 -0500 Subject: [PATCH] wip: adds call priority and non-recordable editors to the alias multi-select editor. Changes example hyperlink to 'Help'. Ensures editor only allows 1 instance of call priority or non-recordable can be added to any alias. --- src/alias/Alias.java | 3 + src/alias/action/AliasActionEditor.java | 11 ++- src/alias/action/beep/BeepActionEditor.java | 10 +-- src/alias/action/clip/ClipActionEditor.java | 10 +-- .../action/script/ScriptActionEditor.java | 10 +-- src/alias/id/AliasIdentifierEditor.java | 43 ++++++++++-- src/alias/id/esn/ESNEditor.java | 14 ++-- src/alias/id/fleetsync/FleetsyncIDEditor.java | 14 ++-- src/alias/id/lojack/LoJackIDEditor.java | 14 ++-- src/alias/id/mdc/MDC1200IDEditor.java | 14 ++-- src/alias/id/mobileID/MINEditor.java | 14 ++-- src/alias/id/mpt1327/MPT1327IDEditor.java | 14 ++-- .../id/nonrecordable/NonRecordableEditor.java | 21 +++--- src/alias/id/priority/PriorityEditor.java | 69 ++++++++++--------- src/alias/id/siteID/SiteIDEditor.java | 14 ++-- src/alias/id/status/StatusIDEditor.java | 14 ++-- src/alias/id/talkgroup/TalkgroupIDEditor.java | 14 ++-- src/alias/id/uniqueID/UniqueIDEditor.java | 14 ++-- 18 files changed, 184 insertions(+), 133 deletions(-) diff --git a/src/alias/Alias.java b/src/alias/Alias.java index 8f88540c..b17a92b9 100644 --- a/src/alias/Alias.java +++ b/src/alias/Alias.java @@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlTransient; import alias.action.AliasAction; import alias.id.AliasID; @@ -178,6 +179,7 @@ public class Alias /** * Returns the priority level of this alias, if defined, or the default priority */ + @XmlTransient public int getCallPriority() { for( AliasID id: mAliasIDs ) @@ -231,6 +233,7 @@ public class Alias /** * Inspects the alias for a non-recordable alias id. Default is true; */ + @XmlTransient public boolean isRecordable() { for( AliasID id: getId() ) diff --git a/src/alias/action/AliasActionEditor.java b/src/alias/action/AliasActionEditor.java index 96b0f9a9..c6307fc0 100644 --- a/src/alias/action/AliasActionEditor.java +++ b/src/alias/action/AliasActionEditor.java @@ -228,9 +228,14 @@ public class AliasActionEditor extends Editor @Override public void save() { - if( mEditorContainer.isModified() ) + if( isModified() || mEditorContainer.isModified() ) { - mEditorContainer.save(); + if( mEditorContainer.isModified() ) + { + mEditorContainer.save(); + } + + setModified( false ); if( hasItem() ) { @@ -316,6 +321,8 @@ public class AliasActionEditor extends Editor setItem( alias ); mAliasActionList.setSelectedValue( action, true ); + + AliasActionEditor.this.setModified( true ); } } ); } diff --git a/src/alias/action/beep/BeepActionEditor.java b/src/alias/action/beep/BeepActionEditor.java index 139f01e0..ccf74e7e 100644 --- a/src/alias/action/beep/BeepActionEditor.java +++ b/src/alias/action/beep/BeepActionEditor.java @@ -141,10 +141,10 @@ public class BeepActionEditor extends DocumentListenerEditor add( mPeriodSliderLabel ); add( mPeriodSlider, "wrap,grow" ); - JLabel example = new JLabel( "Help ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) @@ -153,7 +153,7 @@ public class BeepActionEditor extends DocumentListenerEditor HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } @Override diff --git a/src/alias/action/clip/ClipActionEditor.java b/src/alias/action/clip/ClipActionEditor.java index 070e0ce9..6764a8d9 100644 --- a/src/alias/action/clip/ClipActionEditor.java +++ b/src/alias/action/clip/ClipActionEditor.java @@ -232,10 +232,10 @@ public class ClipActionEditor extends DocumentListenerEditor add( testButton, "grow,wrap" ); - JLabel example = new JLabel( "Help ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) @@ -244,7 +244,7 @@ public class ClipActionEditor extends DocumentListenerEditor HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } @Override diff --git a/src/alias/action/script/ScriptActionEditor.java b/src/alias/action/script/ScriptActionEditor.java index ea7e181e..b89d50f7 100644 --- a/src/alias/action/script/ScriptActionEditor.java +++ b/src/alias/action/script/ScriptActionEditor.java @@ -229,10 +229,10 @@ public class ScriptActionEditor extends DocumentListenerEditor add( testButton, "grow,wrap" ); - JLabel example = new JLabel( "Help ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) @@ -241,7 +241,7 @@ public class ScriptActionEditor extends DocumentListenerEditor HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } @Override diff --git a/src/alias/id/AliasIdentifierEditor.java b/src/alias/id/AliasIdentifierEditor.java index f2b89a48..1e72467f 100644 --- a/src/alias/id/AliasIdentifierEditor.java +++ b/src/alias/id/AliasIdentifierEditor.java @@ -135,9 +135,35 @@ public class AliasIdentifierEditor extends Editor menu.add( new AddAliasIdentifierItem( AliasIDType.Site ) ); menu.add( new AddAliasIdentifierItem( AliasIDType.Status ) ); menu.add( new AddAliasIdentifierItem( AliasIDType.Talkgroup ) ); - menu.addSeparator(); - menu.add( new AddAliasIdentifierItem( AliasIDType.Priority ) ); - menu.add( new AddAliasIdentifierItem( AliasIDType.NonRecordable ) ); + + boolean separatorAdded = false; + + if( hasItem() ) + { + Alias alias = getItem(); + + if( !alias.hasCallPriority() ) + { + if( !separatorAdded ) + { + menu.addSeparator(); + separatorAdded = true; + } + + menu.add( new AddAliasIdentifierItem( AliasIDType.Priority ) ); + } + + if( alias.isRecordable() ) + { + if( !separatorAdded ) + { + menu.addSeparator(); + separatorAdded = true; + } + + menu.add( new AddAliasIdentifierItem( AliasIDType.NonRecordable ) ); + } + } menu.show( e.getComponent(), e.getX(), e.getY() ); } @@ -238,9 +264,14 @@ public class AliasIdentifierEditor extends Editor @Override public void save() { - if( mEditorContainer.isModified() ) + if( isModified() || mEditorContainer.isModified() ) { - mEditorContainer.save(); + if( mEditorContainer.isModified() ) + { + mEditorContainer.save(); + } + + setModified( false ); if( hasItem() ) { @@ -326,6 +357,8 @@ public class AliasIdentifierEditor extends Editor setItem( alias ); mAliasIDList.setSelectedValue( id, true ); + + AliasIdentifierEditor.this.setModified( true ); } } ); } diff --git a/src/alias/id/esn/ESNEditor.java b/src/alias/id/esn/ESNEditor.java index 5973c291..fd36ed47 100644 --- a/src/alias/id/esn/ESNEditor.java +++ b/src/alias/id/esn/ESNEditor.java @@ -36,7 +36,7 @@ public class ESNEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = - "

Electronic Serial Number (ESN) Example

" + "

Electronic Serial Number (ESN)

" + "ESN: hexadecimal 0-9, A-F (e.g. ABCD1234 )
" + "Wildcard: use an asterisk (*) to wildcard individual
" + "digits (e.g. ABCD123* or AB**1**4)" @@ -61,19 +61,19 @@ public class ESNEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( ESNEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public Esn getEsn() diff --git a/src/alias/id/fleetsync/FleetsyncIDEditor.java b/src/alias/id/fleetsync/FleetsyncIDEditor.java index b4dbc7ba..64f8f531 100644 --- a/src/alias/id/fleetsync/FleetsyncIDEditor.java +++ b/src/alias/id/fleetsync/FleetsyncIDEditor.java @@ -44,7 +44,7 @@ public class FleetsyncIDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

Fleetsync Identifier Example

" + + "

Fleetsync Identifier

" + "Fleetsync: ggg-uuuu where g=Group and u=Unit (e.g. 001-0001)
" + "Wildcard: use an asterisk (*) for each digit (e.g. 001-****)" + ""; @@ -82,19 +82,19 @@ public class FleetsyncIDEditor extends DocumentListenerEditor add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( FleetsyncIDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public FleetsyncID getFleetsyncID() diff --git a/src/alias/id/lojack/LoJackIDEditor.java b/src/alias/id/lojack/LoJackIDEditor.java index aa6ae805..8c13e60e 100644 --- a/src/alias/id/lojack/LoJackIDEditor.java +++ b/src/alias/id/lojack/LoJackIDEditor.java @@ -47,7 +47,7 @@ public class LoJackIDEditor extends DocumentListenerEditor private JComboBox mFunctionCombo; private static final String HELP_TEXT = "" - + "

LoJack Example

" + + "

LoJack Function and Identifier

" + "Function Code: 1Y-SITE ID
" + "ID: 5 numbers or characters (e.g. 1BN47)
" + "
" @@ -103,19 +103,19 @@ public class LoJackIDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( LoJackIDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public LoJackFunctionAndID getLoJackID() diff --git a/src/alias/id/mdc/MDC1200IDEditor.java b/src/alias/id/mdc/MDC1200IDEditor.java index eb092e35..21437cb9 100644 --- a/src/alias/id/mdc/MDC1200IDEditor.java +++ b/src/alias/id/mdc/MDC1200IDEditor.java @@ -38,7 +38,7 @@ public class MDC1200IDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

MDC-1200 Identifier Example

" + + "

MDC-1200 Identifier

" + "MDC-1200: four digit [0-9] value (e.g. 1234)
" + "Wildcard: use an asterisk (*) to wildcard individual
" + "digits (e.g. 123* or **34)" @@ -76,19 +76,19 @@ public class MDC1200IDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( MDC1200IDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public MDC1200ID getMDC1200ID() diff --git a/src/alias/id/mobileID/MINEditor.java b/src/alias/id/mobileID/MINEditor.java index f873e70e..6244ff69 100644 --- a/src/alias/id/mobileID/MINEditor.java +++ b/src/alias/id/mobileID/MINEditor.java @@ -38,7 +38,7 @@ public class MINEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

Passport Mobile ID (MIN) Example

" + + "

Passport Mobile ID (MIN)

" + "MIN: six character hex value (e.g. AB12CD)
" + "Wildcard: use an asterisk (*) to wildcard individual
" + "digits (e.g. AB**CD or AB12**)" @@ -76,19 +76,19 @@ public class MINEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( MINEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public Min getMin() diff --git a/src/alias/id/mpt1327/MPT1327IDEditor.java b/src/alias/id/mpt1327/MPT1327IDEditor.java index 1e9283c8..6c487814 100644 --- a/src/alias/id/mpt1327/MPT1327IDEditor.java +++ b/src/alias/id/mpt1327/MPT1327IDEditor.java @@ -38,7 +38,7 @@ public class MPT1327IDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

MPT-1327 Identifier Example

" + + "

MPT-1327 Identifier

" + "MPT-1327: decimal (0-9) format ppp-iiii where
" + "p=Prefix and i=Ident (e.g. 123-0001)
" + "Wildcard: use an asterisk (*) to wildcard individual
" @@ -78,19 +78,19 @@ public class MPT1327IDEditor extends DocumentListenerEditor add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( MPT1327IDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public MPT1327ID getMPT1327ID() diff --git a/src/alias/id/nonrecordable/NonRecordableEditor.java b/src/alias/id/nonrecordable/NonRecordableEditor.java index 35578a51..6f402371 100644 --- a/src/alias/id/nonrecordable/NonRecordableEditor.java +++ b/src/alias/id/nonrecordable/NonRecordableEditor.java @@ -35,10 +35,13 @@ public class NonRecordableEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

Audio Non-Recordable Example

" + + "

Audio Non-Recordable

" + "This identifies an alias as non-recordable.

" - + "The alias can still be monitored but associated audio will not be recorded
" - + "when recording is enabled for the decoding channel."; + + "The alias can still be monitored but associated audio will
" + + "not be recorded.

" + + "The default behavior when audio recording is enabled for a
" + + "channel is to record all aliases except any alias with a
" + + "non-recordable identifier"; public NonRecordableEditor( AliasID aliasID ) { @@ -53,19 +56,19 @@ public class NonRecordableEditor extends DocumentListenerEditor add( new JLabel( "Non-Recordable" ), "wrap" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( NonRecordableEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } @Override diff --git a/src/alias/id/priority/PriorityEditor.java b/src/alias/id/priority/PriorityEditor.java index db3868e2..9b62ff3f 100644 --- a/src/alias/id/priority/PriorityEditor.java +++ b/src/alias/id/priority/PriorityEditor.java @@ -43,14 +43,14 @@ public class PriorityEditor extends DocumentListenerEditor public static final String DO_NOT_MONITOR = "Do Not Monitor"; private static final String HELP_TEXT = "" - + "

Call Audio Priority Example

" + + "

Call Audio Priority

" + "Priority determines which calls have priority for playback
" + "over your computer speakers, or designates an alias for
" + "no-monitoring if you don't want to hear calls from an alias.

" - + "Lower values indicate higher priority levels." + + "Lower values indicate higher priority levels.

" + + "Do Not Monitor: slide priority all the way to the right" + ""; - private JCheckBox mDoNotMonitorCheckBox = new JCheckBox( DO_NOT_MONITOR ); private JSlider mPrioritySlider; private JLabel mPrioritySliderLabel; @@ -65,20 +65,9 @@ public class PriorityEditor extends DocumentListenerEditor { setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); - mDoNotMonitorCheckBox.setToolTipText( HELP_TEXT ); - mDoNotMonitorCheckBox.addActionListener( new ActionListener() - { - @Override - public void actionPerformed( ActionEvent e ) - { - setModified( true ); - } - } ); - add( mDoNotMonitorCheckBox, "span,align center" ); - mPrioritySlider = new JSlider( JSlider.HORIZONTAL, Priority.MIN_PRIORITY, - Priority.MAX_PRIORITY, + Priority.MAX_PRIORITY + 1, Priority.MIN_PRIORITY ); mPrioritySlider.setMajorTickSpacing( 20 ); @@ -91,29 +80,39 @@ public class PriorityEditor extends DocumentListenerEditor @Override public void stateChanged( ChangeEvent e ) { - mPrioritySliderLabel.setText( "Priority: " + mPrioritySlider.getValue() ); + int priority = mPrioritySlider.getValue(); + + if( priority == Priority.MAX_PRIORITY + 1 ) + { + mPrioritySliderLabel.setText( "Priority: Do Not Monitor" ); + } + else + { + mPrioritySliderLabel.setText( "Priority: " + priority ); + } + setModified( true ); } } ); mPrioritySlider.setToolTipText( HELP_TEXT ); mPrioritySliderLabel = new JLabel( "Priority: " + mPrioritySlider.getValue() + " " ); - add( mPrioritySliderLabel ); - add( mPrioritySlider, "wrap,grow" ); + add( mPrioritySliderLabel, "span,align center" ); + add( mPrioritySlider, "span,grow" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( PriorityEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public Priority getPriority() @@ -135,8 +134,14 @@ public class PriorityEditor extends DocumentListenerEditor if( priority != null ) { - mPrioritySlider.setValue( priority.getPriority() ); - mDoNotMonitorCheckBox.setSelected( priority.isDoNotMonitor() ); + int value = priority.getPriority(); + + if( value == Priority.DO_NOT_MONITOR ) + { + value = Priority.MAX_PRIORITY + 1; + } + + mPrioritySlider.setValue( value ); } setModified( false ); @@ -151,14 +156,14 @@ public class PriorityEditor extends DocumentListenerEditor if( priority != null ) { - if( mDoNotMonitorCheckBox.isSelected() ) + int value = mPrioritySlider.getValue(); + + if( value == Priority.MAX_PRIORITY + 1 ) { - priority.setPriority( Priority.DO_NOT_MONITOR ); - } - else - { - priority.setPriority( mPrioritySlider.getValue() ); + value = Priority.DO_NOT_MONITOR; } + + priority.setPriority( value ); } setModified( false ); diff --git a/src/alias/id/siteID/SiteIDEditor.java b/src/alias/id/siteID/SiteIDEditor.java index b9a1367a..7df5fa7a 100644 --- a/src/alias/id/siteID/SiteIDEditor.java +++ b/src/alias/id/siteID/SiteIDEditor.java @@ -36,7 +36,7 @@ public class SiteIDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

Site ID Example

" + + "

Site Identifier

" + "LTR-Net: decimal (0-9) (e.g. 019)
" + "MPT-1327: 5 digits (0-9) (e.g. 23619)
" + "Passport: 3 digits (0-9) (e.g. 019)
" @@ -63,20 +63,20 @@ public class SiteIDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( SiteIDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public SiteID getSiteID() diff --git a/src/alias/id/status/StatusIDEditor.java b/src/alias/id/status/StatusIDEditor.java index e97dd0eb..e4dc8e3d 100644 --- a/src/alias/id/status/StatusIDEditor.java +++ b/src/alias/id/status/StatusIDEditor.java @@ -38,7 +38,7 @@ public class StatusIDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

Status Example

" + + "

Status Identifier

" + "Status numbers are used in some protocols like Fleetsync.

" + "The status number is assigned a meaning in the radio. You
" + "can assign a 3 digit status code (use leading zeros) to an
" @@ -78,19 +78,19 @@ public class StatusIDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( StatusIDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public StatusID getStatusID() diff --git a/src/alias/id/talkgroup/TalkgroupIDEditor.java b/src/alias/id/talkgroup/TalkgroupIDEditor.java index f7ab1a96..6a63faf6 100644 --- a/src/alias/id/talkgroup/TalkgroupIDEditor.java +++ b/src/alias/id/talkgroup/TalkgroupIDEditor.java @@ -36,7 +36,7 @@ public class TalkgroupIDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = - "

Talkgroup Identifier Examples

" + "

Talkgroup Identifier

" + "P25: 4 or 6 hex characters (e.g. AB12 or ABC123)
" + "LTR: A-HH-TTT where A=Area H=Home T=Talkgroup (0-01-128)
" + "Passport: 5-digit number (12345 or 00023)
" @@ -64,19 +64,19 @@ public class TalkgroupIDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( TalkgroupIDEditor.this, - HELP_TEXT, "Examples", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public TalkgroupID getTalkgroupID() diff --git a/src/alias/id/uniqueID/UniqueIDEditor.java b/src/alias/id/uniqueID/UniqueIDEditor.java index 8042c54d..ea0aa3be 100644 --- a/src/alias/id/uniqueID/UniqueIDEditor.java +++ b/src/alias/id/uniqueID/UniqueIDEditor.java @@ -36,7 +36,7 @@ public class UniqueIDEditor extends DocumentListenerEditor private static final long serialVersionUID = 1L; private static final String HELP_TEXT = "" - + "

LTR-Net Unique ID (UID) Example

" + + "

LTR-Net Unique ID (UID)

" + "UID: identifier assigned to each radio in
" + "the range 1 - 2097152" + ""; @@ -60,19 +60,19 @@ public class UniqueIDEditor extends DocumentListenerEditor mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JLabel example = new JLabel( "Example ..." ); - example.setForeground( Color.BLUE.brighter() ); - example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); - example.addMouseListener( new MouseAdapter() + JLabel help = new JLabel( "Help ..." ); + help.setForeground( Color.BLUE.brighter() ); + help.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + help.addMouseListener( new MouseAdapter() { @Override public void mouseClicked( MouseEvent e ) { JOptionPane.showMessageDialog( UniqueIDEditor.this, - HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE ); } } ); - add( example ); + add( help, "align left" ); } public UniqueID getUniqueID()