From e31b6adf52d81eea4c9957a2c522bf0e831bd45e Mon Sep 17 00:00:00 2001 From: denny Date: Sun, 28 Feb 2016 10:06:28 -0500 Subject: [PATCH] Updated help text display for each of the alias identifier editors. --- src/alias/id/esn/ESNEditor.java | 38 +++++++++++----- src/alias/id/fleetsync/FleetsyncIDEditor.java | 34 ++++++++++---- src/alias/id/lojack/LoJackIDEditor.java | 44 ++++++++++++++----- src/alias/id/mdc/MDC1200IDEditor.java | 36 +++++++++++---- src/alias/id/mobileID/MINEditor.java | 36 +++++++++++---- src/alias/id/mpt1327/MPT1327IDEditor.java | 37 ++++++++++++---- .../id/nonrecordable/NonRecordableEditor.java | 37 ++++++++++++---- src/alias/id/priority/PriorityEditor.java | 39 +++++++++++----- src/alias/id/siteID/SiteIDEditor.java | 40 ++++++++++++----- src/alias/id/status/StatusIDEditor.java | 39 +++++++++++----- src/alias/id/talkgroup/TalkgroupIDEditor.java | 41 ++++++++++++----- src/alias/id/uniqueID/UniqueIDEditor.java | 34 ++++++++++---- 12 files changed, 341 insertions(+), 114 deletions(-) diff --git a/src/alias/id/esn/ESNEditor.java b/src/alias/id/esn/ESNEditor.java index 1ace4da8..2aa59876 100644 --- a/src/alias/id/esn/ESNEditor.java +++ b/src/alias/id/esn/ESNEditor.java @@ -17,25 +17,31 @@ ******************************************************************************/ package alias.id.esn; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JTextArea; import javax.swing.JTextField; import net.miginfocom.swing.MigLayout; import alias.AliasID; import alias.ComponentEditor; +import alias.id.talkgroup.TalkgroupIDEditor; public class ESNEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "An Electronic Serial Number (ESN)" - + " is a unique radio hardware identifier normally composed of" - + " hexadecimal (0-9,A-F) characters. Use an asterisk (*) to wildcard" - + " individual digits (e.g. ABCD123* or AB**1**4)"; + private static final String HELP_TEXT = + "

Electronic Serial Number (ESN) Example

" + + "ESN: hexadecimal 0-9, A-F (e.g. ABCD1234 )
" + + "Wildcard: use an asterisk (*) to wildcard individual
" + + "digits (e.g. ABCD123* or AB**1**4)" + + ""; private JTextField mTextField; @@ -50,17 +56,27 @@ public class ESNEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "ESN:" ) ); mTextField = new JTextField(); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( ESNEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public Esn getEsn() diff --git a/src/alias/id/fleetsync/FleetsyncIDEditor.java b/src/alias/id/fleetsync/FleetsyncIDEditor.java index 9075ee7f..8bb1bc06 100644 --- a/src/alias/id/fleetsync/FleetsyncIDEditor.java +++ b/src/alias/id/fleetsync/FleetsyncIDEditor.java @@ -17,11 +17,16 @@ ******************************************************************************/ package alias.id.fleetsync; +import java.awt.Color; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JFormattedTextField; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -33,6 +38,7 @@ import controller.channel.Channel; import net.miginfocom.swing.MigLayout; import alias.AliasID; import alias.ComponentEditor; +import alias.id.esn.ESNEditor; public class FleetsyncIDEditor extends ComponentEditor { @@ -40,9 +46,11 @@ public class FleetsyncIDEditor extends ComponentEditor private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "A Fleetsync identifier is a" - + " composite decimal [0-9] value formatted as ggg-uuuu where" - + " g=Group and u=Unit."; + private static final String HELP_TEXT = "" + + "

Fleetsync Identifier Example

" + + "Fleetsync: ggg-uuuu where g=Group and u=Unit (e.g. 001-0001)
" + + "Wildcard: use an asterisk (*) for each digit (e.g. 001-****)" + + ""; private JTextField mTextField; @@ -57,7 +65,7 @@ public class FleetsyncIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "Fleetsync ID:" ) ); @@ -75,13 +83,23 @@ public class FleetsyncIDEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( FleetsyncIDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public FleetsyncID getFleetsyncID() diff --git a/src/alias/id/lojack/LoJackIDEditor.java b/src/alias/id/lojack/LoJackIDEditor.java index 551dc82d..6fcf9ad4 100644 --- a/src/alias/id/lojack/LoJackIDEditor.java +++ b/src/alias/id/lojack/LoJackIDEditor.java @@ -17,13 +17,17 @@ ******************************************************************************/ package alias.id.lojack; +import java.awt.Color; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JComboBox; import javax.swing.JFormattedTextField; import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -41,10 +45,19 @@ public class LoJackIDEditor extends ComponentEditor private JComboBox mFunctionCombo; - private static final String HELP_TEXT = "LoJack function code and five character ID." - + " The middle character in a reply ID code identifies the entity:" - + " Tower[X,Y] Transponder[0-9,A,C-H,J-N,P-W] Not Used[B,I,O,Z]." - + " Use an asterisk (*) to wildcard ID characters (e.g. AB*CD or ***12 or *****)"; + private static final String HELP_TEXT = "" + + "

LoJack Example

" + + "Function Code: 1Y-SITE ID
" + + "ID: 5 numbers or characters (e.g. 1BN47)
" + + "
" + + "Wildcard: use an asterisk (*) to wildcard ID
" + + "characters (e.g. AB*CD or ***12 or *****)

" + + "The middle character in a reply ID code identifies the
" + + "entity. Valid ID middle characters are:
" + + "
  • Tower: X,Y
  • " + + "
  • Transponder: 0-9,A,C-H,J-N,P-W
  • " + + "
  • Not Used: B,I,O,Z
  • " + + ""; public LoJackIDEditor( AliasID aliasID ) { @@ -57,7 +70,7 @@ public class LoJackIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][]" ) ); add( new JLabel( "Function:" ) ); mFunctionCombo = new JComboBox( Function.values() ); @@ -69,6 +82,7 @@ public class LoJackIDEditor extends ComponentEditor setModified( true ); } } ); + mFunctionCombo.setToolTipText( HELP_TEXT ); add( mFunctionCombo, "growx, push" ); add( new JLabel( "ID:" ) ); @@ -87,12 +101,22 @@ public class LoJackIDEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( LoJackIDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public LoJackFunctionAndID getLoJackID() diff --git a/src/alias/id/mdc/MDC1200IDEditor.java b/src/alias/id/mdc/MDC1200IDEditor.java index 2f23bacb..cae6ae6d 100644 --- a/src/alias/id/mdc/MDC1200IDEditor.java +++ b/src/alias/id/mdc/MDC1200IDEditor.java @@ -17,9 +17,14 @@ ******************************************************************************/ package alias.id.mdc; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JFormattedTextField; import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -31,9 +36,12 @@ public class MDC1200IDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "An MDC-1200 identifier is a" - + " four digit [0-9] value. Use an asterisk (*) to wildcard" - + " individual digits (e.g. 123* or **34)"; + private static final String HELP_TEXT = "" + + "

    MDC-1200 Identifier Example

    " + + "MDC-1200: four digit [0-9] value (e.g. 1234)
    " + + "Wildcard: use an asterisk (*) to wildcard individual
    " + + "digits (e.g. 123* or **34)" + + ""; private JTextField mTextField; @@ -48,7 +56,7 @@ public class MDC1200IDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "MDC-1200 ID:" ) ); @@ -66,12 +74,22 @@ public class MDC1200IDEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( MDC1200IDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public MDC1200ID getMDC1200ID() diff --git a/src/alias/id/mobileID/MINEditor.java b/src/alias/id/mobileID/MINEditor.java index aaac927d..972a6764 100644 --- a/src/alias/id/mobileID/MINEditor.java +++ b/src/alias/id/mobileID/MINEditor.java @@ -17,11 +17,14 @@ ******************************************************************************/ package alias.id.mobileID; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.JFormattedTextField; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -29,13 +32,18 @@ import javax.swing.text.MaskFormatter; import net.miginfocom.swing.MigLayout; import alias.AliasID; import alias.ComponentEditor; +import alias.id.esn.ESNEditor; public class MINEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "A Passport Mobile Identifier (MIN) is a" - + " six character hexadecimal value"; + private static final String HELP_TEXT = "" + + "

    Passport Mobile ID (MIN) Example

    " + + "MIN: six character hex value (e.g. AB12CD)
    " + + "Wildcard: use an asterisk (*) to wildcard individual
    " + + "digits (e.g. AB**CD or AB12**)" + + ""; private JTextField mTextField; @@ -50,7 +58,7 @@ public class MINEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "MIN:" ) ); @@ -68,12 +76,22 @@ public class MINEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( MINEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public Min getMin() diff --git a/src/alias/id/mpt1327/MPT1327IDEditor.java b/src/alias/id/mpt1327/MPT1327IDEditor.java index c1e7e674..a46709b8 100644 --- a/src/alias/id/mpt1327/MPT1327IDEditor.java +++ b/src/alias/id/mpt1327/MPT1327IDEditor.java @@ -17,9 +17,14 @@ ******************************************************************************/ package alias.id.mpt1327; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JFormattedTextField; import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -31,9 +36,13 @@ public class MPT1327IDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "An MPT-1327 identifier is a" - + " composite decimal [0-9] value formatted as ppp-iiii where" - + " p=Prefix and i=Ident."; + private static final String HELP_TEXT = "" + + "

    MPT-1327 Identifier Example

    " + + "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
    " + + "digits (e.g. ABCD123* or AB**1**4)" + + ""; private JTextField mTextField; @@ -48,7 +57,7 @@ public class MPT1327IDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "MPT-1327 ID:" ) ); @@ -66,13 +75,23 @@ public class MPT1327IDEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( MPT1327IDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public MPT1327ID getMPT1327ID() diff --git a/src/alias/id/nonrecordable/NonRecordableEditor.java b/src/alias/id/nonrecordable/NonRecordableEditor.java index 220a9d5d..54aab852 100644 --- a/src/alias/id/nonrecordable/NonRecordableEditor.java +++ b/src/alias/id/nonrecordable/NonRecordableEditor.java @@ -17,7 +17,13 @@ ******************************************************************************/ package alias.id.nonrecordable; -import javax.swing.JTextArea; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JLabel; +import javax.swing.JOptionPane; import net.miginfocom.swing.MigLayout; import alias.AliasID; @@ -27,9 +33,11 @@ public class NonRecordableEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "This identifies an alias as " - + "non-recordable. The alias can still be monitored but it will " - + "not be recorded when recording is enabled for the decoding channel."; + private static final String HELP_TEXT = "" + + "

    Non-Recordable Example

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

    " + + "The alias can still be monitored but it will not be recorded
    " + + "when recording is enabled for the decoding channel."; public NonRecordableEditor( AliasID aliasID ) { @@ -42,12 +50,23 @@ public class NonRecordableEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 1", "[]", "[][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 1", "[]", "[][]" ) ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + 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() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( NonRecordableEditor.this, + HELP_TEXT, "Examples", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } @Override diff --git a/src/alias/id/priority/PriorityEditor.java b/src/alias/id/priority/PriorityEditor.java index ccdbb36a..608b827e 100644 --- a/src/alias/id/priority/PriorityEditor.java +++ b/src/alias/id/priority/PriorityEditor.java @@ -17,10 +17,15 @@ ******************************************************************************/ package alias.id.priority; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JCheckBox; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JSlider; -import javax.swing.JTextArea; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -34,10 +39,13 @@ public class PriorityEditor extends ComponentEditor public static final String DO_NOT_MONITOR = "Do Not Monitor"; - private static final String HELP_TEXT = "Priority determines which calls" - + " have priority for playback over your computer speakers, or designates" - + " an alias for non-monitoring if you don't want to hear calls" - + " from an alias. Lower values indicate higher priority levels."; + private static final String HELP_TEXT = "" + + "

    Call Priority Example

    " + + "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." + + ""; private JCheckBox mDoNotMonitorCheckBox = new JCheckBox( DO_NOT_MONITOR ); private JSlider mPrioritySlider; @@ -54,8 +62,9 @@ public class PriorityEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); + mDoNotMonitorCheckBox.setToolTipText( HELP_TEXT ); add( mDoNotMonitorCheckBox, "span,align center" ); mPrioritySlider = new JSlider( JSlider.HORIZONTAL, @@ -76,15 +85,25 @@ public class PriorityEditor extends ComponentEditor mPrioritySliderLabel.setText( "Priority: " + mPrioritySlider.getValue() ); } } ); + mPrioritySlider.setToolTipText( HELP_TEXT ); mPrioritySliderLabel = new JLabel( "Priority: " + mPrioritySlider.getValue() + " " ); add( mPrioritySliderLabel ); add( mPrioritySlider, "wrap,grow" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( PriorityEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public Priority getPriority() diff --git a/src/alias/id/siteID/SiteIDEditor.java b/src/alias/id/siteID/SiteIDEditor.java index a352fd94..4850422a 100644 --- a/src/alias/id/siteID/SiteIDEditor.java +++ b/src/alias/id/siteID/SiteIDEditor.java @@ -17,8 +17,13 @@ ******************************************************************************/ package alias.id.siteID; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import net.miginfocom.swing.MigLayout; @@ -29,10 +34,14 @@ public class SiteIDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "Site number for P25 systems uses" - + " the format RR-SS, where RR = RF Subsystem and SS = Site Number. " - + " (e.g. RFSS 1 Site 3: 01-03). For other protocols, simply use" - + " a decimal value for the site ID"; + private static final String HELP_TEXT = "" + + "

    Site ID Example

    " + + "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)
    " + + "P25: hex (0-9, A-F) format RR-SS where RR = RF Subsystem
    " + + "and SS = Site Number (e.g. RFSS 1 Site 1F: 01-1F)" + + ""; private JTextField mTextField; @@ -47,17 +56,28 @@ public class SiteIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "Site ID:" ) ); mTextField = new JTextField(); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( SiteIDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + + add( example ); } public SiteID getSiteID() diff --git a/src/alias/id/status/StatusIDEditor.java b/src/alias/id/status/StatusIDEditor.java index d0575e2c..db0d6daf 100644 --- a/src/alias/id/status/StatusIDEditor.java +++ b/src/alias/id/status/StatusIDEditor.java @@ -17,9 +17,14 @@ ******************************************************************************/ package alias.id.status; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JFormattedTextField; import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.text.MaskFormatter; @@ -31,10 +36,14 @@ public class StatusIDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "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" - + " alias where the alias contains the status meaning."; + private static final String HELP_TEXT = "" + + "

    Status Example

    " + + "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
    " + + "alias where the alias contains the status meaning.

    " + + "Status: 001 engine start" + + ""; private JTextField mTextField; @@ -49,7 +58,7 @@ public class StatusIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "Status:" ) ); @@ -67,12 +76,22 @@ public class StatusIDEditor extends ComponentEditor mTextField = new JFormattedTextField( formatter ); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( StatusIDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public StatusID getStatusID() diff --git a/src/alias/id/talkgroup/TalkgroupIDEditor.java b/src/alias/id/talkgroup/TalkgroupIDEditor.java index 4bae20ac..981a00c7 100644 --- a/src/alias/id/talkgroup/TalkgroupIDEditor.java +++ b/src/alias/id/talkgroup/TalkgroupIDEditor.java @@ -17,8 +17,13 @@ ******************************************************************************/ package alias.id.talkgroup; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import net.miginfocom.swing.MigLayout; @@ -29,11 +34,14 @@ public class TalkgroupIDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "Enter a formatted talkgroup identifier.\n" - + "P25: 4 or 6 hex characters (e.g. AB12 or ABC123)\n" - + "LTR: A-HH-TTT (A=Area H=Home T=Talkgroup)\n" - + "Passport: xxxxx (up to 5-digit number)\n\n" - + "Wildcard: use an asterisk (*) in place of each talkgroup digit"; + private static final String HELP_TEXT = + "

    Talkgroup Identifier Examples

    " + + "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)
    " + + "
    " + + "Wildcard: use an asterisk (*) in place of each talkgroup digit (e.g. 0*1*5)" + + ""; private JTextField mTextField; @@ -48,17 +56,28 @@ public class TalkgroupIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "Talkgroup:" ) ); + mTextField = new JTextField(); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( TalkgroupIDEditor.this, + HELP_TEXT, "Examples", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public TalkgroupID getTalkgroupID() diff --git a/src/alias/id/uniqueID/UniqueIDEditor.java b/src/alias/id/uniqueID/UniqueIDEditor.java index 349f66b6..7a90c6aa 100644 --- a/src/alias/id/uniqueID/UniqueIDEditor.java +++ b/src/alias/id/uniqueID/UniqueIDEditor.java @@ -17,8 +17,13 @@ ******************************************************************************/ package alias.id.uniqueID; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + import javax.swing.JLabel; -import javax.swing.JTextArea; +import javax.swing.JOptionPane; import javax.swing.JTextField; import net.miginfocom.swing.MigLayout; @@ -29,8 +34,11 @@ public class UniqueIDEditor extends ComponentEditor { private static final long serialVersionUID = 1L; - private static final String HELP_TEXT = "LTR-Net Unique ID (UID) is a system" - + " identifier assigned to each radio in the range 1 - 2097152"; + private static final String HELP_TEXT = "" + + "

    LTR-Net Unique ID (UID) Example

    " + + "UID: identifier assigned to each radio in
    " + + "the range 1 - 2097152" + + ""; private JTextField mTextField; @@ -45,17 +53,27 @@ public class UniqueIDEditor extends ComponentEditor private void initGUI() { - setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][grow]" ) ); + setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][]" ) ); add( new JLabel( "Unique ID:" ) ); mTextField = new JTextField(); mTextField.getDocument().addDocumentListener( this ); + mTextField.setToolTipText( HELP_TEXT ); add( mTextField, "growx,push" ); - JTextArea helpText = new JTextArea( HELP_TEXT ); - helpText.setLineWrap( true ); - helpText.setBackground( getBackground() ); - add( helpText, "span,grow,push" ); + JLabel example = new JLabel( "Example ..." ); + example.setForeground( Color.BLUE.brighter() ); + example.setCursor( new Cursor( Cursor.HAND_CURSOR ) ); + example.addMouseListener( new MouseAdapter() + { + @Override + public void mouseClicked( MouseEvent e ) + { + JOptionPane.showMessageDialog( UniqueIDEditor.this, + HELP_TEXT, "Example", JOptionPane.INFORMATION_MESSAGE ); + } + } ); + add( example ); } public UniqueID getUniqueID()