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.
This commit is contained in:
denny
2016-03-05 08:23:08 -05:00
parent 4ad16296d8
commit 8b11fabf3d
18 changed files with 184 additions and 133 deletions

View File

@@ -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() )

View File

@@ -228,9 +228,14 @@ public class AliasActionEditor extends Editor<Alias>
@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<Alias>
setItem( alias );
mAliasActionList.setSelectedValue( action, true );
AliasActionEditor.this.setModified( true );
}
} );
}

View File

@@ -141,10 +141,10 @@ public class BeepActionEditor extends DocumentListenerEditor<AliasAction>
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<AliasAction>
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
}
} );
add( example );
add( help, "align left" );
}
@Override

View File

@@ -232,10 +232,10 @@ public class ClipActionEditor extends DocumentListenerEditor<AliasAction>
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<AliasAction>
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
}
} );
add( example );
add( help, "align left" );
}
@Override

View File

@@ -229,10 +229,10 @@ public class ScriptActionEditor extends DocumentListenerEditor<AliasAction>
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<AliasAction>
HELP_TEXT, "Help", JOptionPane.INFORMATION_MESSAGE );
}
} );
add( example );
add( help, "align left" );
}
@Override

View File

@@ -135,9 +135,35 @@ public class AliasIdentifierEditor extends Editor<Alias>
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<Alias>
@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<Alias>
setItem( alias );
mAliasIDList.setSelectedValue( id, true );
AliasIdentifierEditor.this.setModified( true );
}
} );
}

View File

@@ -36,7 +36,7 @@ public class ESNEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT =
"<html><h3>Electronic Serial Number (ESN) Example</h3>"
"<html><h3>Electronic Serial Number (ESN)</h3>"
+ "<b>ESN:</b> hexadecimal 0-9, A-F (e.g. <u>ABCD1234</u> )<br>"
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
+ "digits (e.g. <u>ABCD123*</u> or <u>AB**1**4</u>)"
@@ -61,19 +61,19 @@ public class ESNEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -44,7 +44,7 @@ public class FleetsyncIDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>Fleetsync Identifier Example</h3>"
+ "<h3>Fleetsync Identifier</h3>"
+ "<b>Fleetsync:</b> ggg-uuuu where g=Group and u=Unit (e.g. <u>001-0001</u>)<br>"
+ "<b>Wildcard:</b> use an asterisk (*) for each digit (e.g. <u>001-****</u>)"
+ "</html>";
@@ -82,19 +82,19 @@ public class FleetsyncIDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -47,7 +47,7 @@ public class LoJackIDEditor extends DocumentListenerEditor<AliasID>
private JComboBox<LJ1200Message.Function> mFunctionCombo;
private static final String HELP_TEXT = "<html>"
+ "<h3>LoJack Example</h3>"
+ "<h3>LoJack Function and Identifier</h3>"
+ "<b>Function Code:</b> <u>1Y-SITE ID</u><br>"
+ "<b>ID:</b> 5 numbers or characters (e.g. <u>1BN47</u>)<br>"
+ "<br>"
@@ -103,19 +103,19 @@ public class LoJackIDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -38,7 +38,7 @@ public class MDC1200IDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>MDC-1200 Identifier Example</h3>"
+ "<h3>MDC-1200 Identifier</h3>"
+ "<b>MDC-1200:</b> four digit [0-9] value (e.g. <u>1234</u>)<br>"
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
+ "digits (e.g. <u>123*</u> or <u>**34</u>)"
@@ -76,19 +76,19 @@ public class MDC1200IDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -38,7 +38,7 @@ public class MINEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>Passport Mobile ID (MIN) Example</h3>"
+ "<h3>Passport Mobile ID (MIN)</h3>"
+ "<b>MIN:</b> six character hex value (e.g. <u>AB12CD</u>)<br>"
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
+ "digits (e.g. <u>AB**CD</u> or <u>AB12**</u>)"
@@ -76,19 +76,19 @@ public class MINEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -38,7 +38,7 @@ public class MPT1327IDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>MPT-1327 Identifier Example</h3>"
+ "<h3>MPT-1327 Identifier</h3>"
+ "<b>MPT-1327:</b> decimal (0-9) format ppp-iiii where<br>"
+ "p=Prefix and i=Ident (e.g. <u>123-0001</u>)<br>"
+ "<b>Wildcard:</b> use an asterisk (*) to wildcard individual<br>"
@@ -78,19 +78,19 @@ public class MPT1327IDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -35,10 +35,13 @@ public class NonRecordableEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>Audio Non-Recordable Example</h3>"
+ "<h3>Audio Non-Recordable</h3>"
+ "This identifies an alias as non-recordable.<br><br>"
+ "The alias can still be monitored but associated audio will not be recorded<br>"
+ "when recording is enabled for the decoding channel.";
+ "The alias can still be monitored but associated audio will<br>"
+ "not be recorded.<br><br>"
+ "The default behavior when audio recording is enabled for a<br>"
+ "channel is to record all aliases except any alias with a<br>"
+ "non-recordable identifier";
public NonRecordableEditor( AliasID aliasID )
{
@@ -53,19 +56,19 @@ public class NonRecordableEditor extends DocumentListenerEditor<AliasID>
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

View File

@@ -43,14 +43,14 @@ public class PriorityEditor extends DocumentListenerEditor<AliasID>
public static final String DO_NOT_MONITOR = "Do Not Monitor";
private static final String HELP_TEXT = "<html>"
+ "<h3>Call Audio Priority Example</h3>"
+ "<h3>Call Audio Priority</h3>"
+ "Priority determines which calls have priority for playback<br>"
+ "over your computer speakers, or designates an alias for<br>"
+ "no-monitoring if you don't want to hear calls from an alias.<br><br>"
+ "Lower values indicate higher priority levels."
+ "Lower values indicate higher priority levels.<br><br>"
+ "<b>Do Not Monitor: </b> slide priority all the way to the right"
+ "</html>";
private JCheckBox mDoNotMonitorCheckBox = new JCheckBox( DO_NOT_MONITOR );
private JSlider mPrioritySlider;
private JLabel mPrioritySliderLabel;
@@ -65,20 +65,9 @@ public class PriorityEditor extends DocumentListenerEditor<AliasID>
{
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<AliasID>
@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<AliasID>
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<AliasID>
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 );

View File

@@ -36,7 +36,7 @@ public class SiteIDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>Site ID Example</h3>"
+ "<h3>Site Identifier</h3>"
+ "<b>LTR-Net:</b> decimal (0-9) (e.g. <u>019</u>)<br>"
+ "<b>MPT-1327:</b> 5 digits (0-9) (e.g. <u>23619</u>)<br>"
+ "<b>Passport:</b> 3 digits (0-9) (e.g. <u>019</u>)<br>"
@@ -63,20 +63,20 @@ public class SiteIDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -38,7 +38,7 @@ public class StatusIDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>Status Example</h3>"
+ "<h3>Status Identifier</h3>"
+ "Status numbers are used in some protocols like Fleetsync.<br><br>"
+ "The status number is assigned a meaning in the radio. You<br>"
+ "can assign a 3 digit status code (use leading zeros) to an<br>"
@@ -78,19 +78,19 @@ public class StatusIDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -36,7 +36,7 @@ public class TalkgroupIDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT =
"<html><h3>Talkgroup Identifier Examples</h3>"
"<html><h3>Talkgroup Identifier</h3>"
+ "<b>P25:</b> 4 or 6 hex characters (e.g. <u>AB12</u> or <u>ABC123</u>)<br>"
+ "<b>LTR:</b> A-HH-TTT where A=Area H=Home T=Talkgroup (<u>0-01-128</u>)<br>"
+ "<b>Passport</b>: 5-digit number (<u>12345</u> or <u>00023</u>)<br>"
@@ -64,19 +64,19 @@ public class TalkgroupIDEditor extends DocumentListenerEditor<AliasID>
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()

View File

@@ -36,7 +36,7 @@ public class UniqueIDEditor extends DocumentListenerEditor<AliasID>
private static final long serialVersionUID = 1L;
private static final String HELP_TEXT = "<html>"
+ "<h3>LTR-Net Unique ID (UID) Example</h3>"
+ "<h3>LTR-Net Unique ID (UID)</h3>"
+ "<b>UID:</b> identifier assigned to each radio in<br>"
+ "the range <u>1 - 2097152</u>"
+ "</html>";
@@ -60,19 +60,19 @@ public class UniqueIDEditor extends DocumentListenerEditor<AliasID>
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()