Interim checkin for call recording.

This commit is contained in:
denny
2015-09-11 14:01:47 -04:00
parent 0f85b7260a
commit 575197bd98
93 changed files with 2349 additions and 2637 deletions

View File

@@ -24,6 +24,7 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import alias.action.AliasAction;
import alias.priority.Priority;
import audio.inverted.AudioType;
public class Alias
@@ -40,7 +41,7 @@ public class Alias
public String toString()
{
return "Alias: " + mName;
return getName();
}
@XmlAttribute
@@ -151,4 +152,36 @@ public class Alias
return AudioType.NORMAL;
}
/**
* Returns the priority level of this alias, if defined, or the default priority
*/
public int getCallPriority()
{
for( AliasID id: mAliasIDs )
{
if( id.getType() == AliasIDType.Priority )
{
return ((Priority)id).getPriority();
}
}
return Priority.DEFAULT_PRIORITY;
}
/**
* Inspects the alias for a non-recordable alias id. Default is true;
*/
public boolean isRecordable()
{
for( AliasID id: getId() )
{
if( id.getType() == AliasIDType.NonRecordable )
{
return false;
}
}
return true;
}
}

View File

@@ -25,6 +25,8 @@ public enum AliasIDType
MDC1200,
MIN,
MPT1327,
NonRecordable,
Priority,
Site,
Status,
Talkgroup;

View File

@@ -31,17 +31,22 @@ import alias.action.AliasAction;
import alias.action.beep.BeepAction;
import alias.action.clip.ClipAction;
import alias.action.script.ScriptAction;
import alias.esn.Esn;
import alias.fleetsync.FleetsyncID;
import alias.fleetsync.StatusID;
import alias.mdc.MDC1200ID;
import alias.mobileID.Min;
import alias.mpt1327.MPT1327ID;
import alias.siteID.SiteID;
import alias.talkgroup.TalkgroupID;
import alias.uniqueID.UniqueID;
import alias.id.esn.Esn;
import alias.id.fleetsync.FleetsyncID;
import alias.id.fleetsync.StatusID;
import alias.id.mdc.MDC1200ID;
import alias.id.mobileID.Min;
import alias.id.mpt1327.MPT1327ID;
import alias.id.siteID.SiteID;
import alias.id.talkgroup.TalkgroupID;
import alias.id.uniqueID.UniqueID;
import alias.priority.Priority;
import alias.record.NonRecordable;
import audio.metadata.MetadataType;
@XmlSeeAlso( { Alias.class,
/* Alias ID's */
AliasID.class,
FleetsyncID.class,
Esn.class,
@@ -54,6 +59,10 @@ import alias.uniqueID.UniqueID;
StatusID.class,
TalkgroupID.class,
/* Alias Attributes */
NonRecordable.class,
Priority.class,
/* Alias Actions */
AliasAction.class,
BeepAction.class,
@@ -518,7 +527,7 @@ public class AliasList implements Comparable<AliasList>
}
}
break;
case FROM_TALKGROUP:
case FROM:
case TO:
return getTalkgroupAlias( value );
case UNIQUE_ID:

View File

@@ -34,24 +34,26 @@ import alias.action.clip.ClipAction;
import alias.action.clip.ClipActionNode;
import alias.action.script.ScriptAction;
import alias.action.script.ScriptActionNode;
import alias.esn.ESNNode;
import alias.esn.Esn;
import alias.fleetsync.FleetsyncID;
import alias.fleetsync.FleetsyncIDNode;
import alias.fleetsync.StatusID;
import alias.fleetsync.StatusIDNode;
import alias.mdc.MDC1200ID;
import alias.mdc.MDC1200IDNode;
import alias.mobileID.MINNode;
import alias.mobileID.Min;
import alias.mpt1327.MPT1327ID;
import alias.mpt1327.MPT1327IDNode;
import alias.siteID.SiteID;
import alias.siteID.SiteIDNode;
import alias.talkgroup.TalkgroupID;
import alias.talkgroup.TalkgroupIDNode;
import alias.uniqueID.UniqueID;
import alias.uniqueID.UniqueIDNode;
import alias.id.esn.ESNNode;
import alias.id.esn.Esn;
import alias.id.fleetsync.FleetsyncID;
import alias.id.fleetsync.FleetsyncIDNode;
import alias.id.fleetsync.StatusID;
import alias.id.fleetsync.StatusIDNode;
import alias.id.mdc.MDC1200ID;
import alias.id.mdc.MDC1200IDNode;
import alias.id.mobileID.MINNode;
import alias.id.mobileID.Min;
import alias.id.mpt1327.MPT1327ID;
import alias.id.mpt1327.MPT1327IDNode;
import alias.id.siteID.SiteID;
import alias.id.siteID.SiteIDNode;
import alias.id.talkgroup.TalkgroupID;
import alias.id.talkgroup.TalkgroupIDNode;
import alias.id.uniqueID.UniqueID;
import alias.id.uniqueID.UniqueIDNode;
import alias.record.NonRecordable;
import alias.record.NonRecordableNode;
import controller.ConfigurableNode;
public class AliasNode extends ConfigurableNode
@@ -95,50 +97,51 @@ public class AliasNode extends ConfigurableNode
{
for( AliasID aliasID: getAlias().getId() )
{
if( aliasID instanceof Esn )
switch( aliasID.getType() )
{
getModel().addNode( new ESNNode( (Esn)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof FleetsyncID )
{
getModel().addNode( new FleetsyncIDNode( (FleetsyncID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof MDC1200ID )
{
getModel().addNode( new MDC1200IDNode( (MDC1200ID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof Min )
{
getModel().addNode( new MINNode( (Min)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof MPT1327ID )
{
getModel().addNode( new MPT1327IDNode( (MPT1327ID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof SiteID )
{
getModel().addNode( new SiteIDNode( (SiteID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof StatusID )
{
getModel().addNode( new StatusIDNode( (StatusID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof TalkgroupID )
{
getModel().addNode( new TalkgroupIDNode( (TalkgroupID)aliasID ),
AliasNode.this, getChildCount() );
}
else if( aliasID instanceof UniqueID )
{
getModel().addNode( new UniqueIDNode( (UniqueID)aliasID ),
AliasNode.this, getChildCount() );
case ESN:
getModel().addNode( new ESNNode( (Esn)aliasID ),
AliasNode.this, getChildCount() );
break;
case Fleetsync:
getModel().addNode( new FleetsyncIDNode( (FleetsyncID)aliasID ),
AliasNode.this, getChildCount() );
break;
case LTRNetUID:
getModel().addNode( new UniqueIDNode( (UniqueID)aliasID ),
AliasNode.this, getChildCount() );
break;
case MDC1200:
getModel().addNode( new MDC1200IDNode( (MDC1200ID)aliasID ),
AliasNode.this, getChildCount() );
break;
case MIN:
getModel().addNode( new MINNode( (Min)aliasID ),
AliasNode.this, getChildCount() );
break;
case MPT1327:
getModel().addNode( new MPT1327IDNode( (MPT1327ID)aliasID ),
AliasNode.this, getChildCount() );
break;
case NonRecordable:
getModel().addNode( new NonRecordableNode( (NonRecordable)aliasID ),
AliasNode.this, getChildCount() );
break;
case Site:
getModel().addNode( new SiteIDNode( (SiteID)aliasID ),
AliasNode.this, getChildCount() );
break;
case Status:
getModel().addNode( new StatusIDNode( (StatusID)aliasID ),
AliasNode.this, getChildCount() );
break;
case Talkgroup:
getModel().addNode( new TalkgroupIDNode( (TalkgroupID)aliasID ),
AliasNode.this, getChildCount() );
break;
default:
throw new IllegalArgumentException( "Unrecognized alias ID [" +
aliasID.getType() + "]");
}
}
@@ -280,6 +283,27 @@ public class AliasNode extends ConfigurableNode
} );
addIDMenu.add( addMPTItem );
JMenuItem nonRecordableItem = new JMenuItem( "Non-Recordable" );
nonRecordableItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
NonRecordable non = new NonRecordable();
getAlias().addAliasID( non );
NonRecordableNode node = new NonRecordableNode( non );
getModel().addNode( node,
AliasNode.this,
AliasNode.this.getChildCount() );
node.show();
}
} );
addIDMenu.add( nonRecordableItem );
JMenuItem addSiteItem = new JMenuItem( "Site" );
addSiteItem.addActionListener( new ActionListener()
{

View File

@@ -1,102 +0,0 @@
package alias;
public class Metadata
{
private MetadataType mMetadataType;
private String mValue;
private Alias mValueAlias;
private boolean mTemporal;
/**
* Constucts a metadata object with the temporal settings. Temporal
* indicates that this metadata will be removed at the end of a reset
* event, or call end event.
*/
public Metadata( MetadataType metadataType, String value, Alias alias, boolean temporal )
{
mMetadataType = metadataType;
mValue = value;
mValueAlias = alias;
mTemporal = temporal;
}
/**
* Constucts a metadata object with the temporal settings. Temporal
* indicates that this metadata will be removed at the end of a reset
* event, or call end event.
*/
public Metadata( MetadataType metadataType, String value, boolean temporal )
{
this( metadataType, value, null, temporal );
}
/**
* Constucts a non-temporal metadata object
*/
public Metadata( MetadataType metadataType, String value, Alias alias )
{
this( metadataType, value, alias, false );
}
/**
* Constucts a non-temporal metadata object
*/
public Metadata( MetadataType metadataType, String value )
{
this( metadataType, value, null, false );
}
public MetadataType getMetadataType()
{
return mMetadataType;
}
public String getKey()
{
return mMetadataType.getLabel();
}
public String getValue()
{
return mValue;
}
public Alias getAlias()
{
return mValueAlias;
}
public boolean hasAlias()
{
return mValueAlias != null;
}
/**
* Indicates that this piece of metadata is only valid for the duration of
* a call event and should be removed during a reset
*/
public boolean isTemporal()
{
return mTemporal;
}
public boolean isReset()
{
return false;
}
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append( mMetadataType.getLabel() );
sb.append( ":" );
sb.append( mValue );
sb.append( " [" );
sb.append( mMetadataType.name() );
sb.append( "] temporal:" );
sb.append( mTemporal );
return sb.toString();
}
}

View File

@@ -1,14 +0,0 @@
package alias;
public class MetadataReset extends Metadata
{
public MetadataReset()
{
super( MetadataType.TEMPORAL_RESET, "reset", true );
}
public boolean isReset()
{
return true;
}
}

View File

@@ -1,38 +0,0 @@
package alias;
public enum MetadataType
{
CHANNEL( "Channel" ),
DETAILS( "Details" ),
ESN( "ESN" ),
FLEETSYNC( "Fleetsync" ),
FREQUENCY( "Frequency" ),
FROM_TALKGROUP( "From" ),
MDC1200( "MDC-1200" ),
MOBILE_ID( "Mobile ID" ),
MPT1327( "MPT-1327" ),
PROTOCOL( "Protocol" ),
SITE_ID( "Site ID" ),
STATUS( "Status" ),
TO( "To" ),
UNIQUE_ID( "Unique ID" ),
TEMPORAL_RESET( "Reset" );
private String mLabel;
private MetadataType( String label )
{
mLabel = label;
}
public String getLabel()
{
return mLabel;
}
public String toString()
{
return mLabel;
}
}

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.esn;
package alias.id.esn;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.esn;
package alias.id.esn;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.esn;
package alias.id.esn;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.fleetsync;
package alias.id.fleetsync;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mdc;
package alias.id.mdc;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mdc;
package alias.id.mdc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mdc;
package alias.id.mdc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mobileID;
package alias.id.mobileID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mobileID;
package alias.id.mobileID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mobileID;
package alias.id.mobileID;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mpt1327;
package alias.id.mpt1327;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mpt1327;
package alias.id.mpt1327;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.mpt1327;
package alias.id.mpt1327;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.siteID;
package alias.id.siteID;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.siteID;
package alias.id.siteID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.siteID;
package alias.id.siteID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.talkgroup;
package alias.id.talkgroup;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.talkgroup;
package alias.id.talkgroup;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.talkgroup;
package alias.id.talkgroup;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.uniqueID;
package alias.id.uniqueID;
import javax.xml.bind.annotation.XmlAttribute;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.uniqueID;
package alias.id.uniqueID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.uniqueID;
package alias.id.uniqueID;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

View File

@@ -0,0 +1,67 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.priority;
import javax.xml.bind.annotation.XmlAttribute;
import alias.AliasID;
import alias.AliasIDType;
/**
* Specifies an (audio) priority level for this alias.
*/
public class Priority extends AliasID
{
public static final int MIN_PRIORITY = 1;
public static final int MAX_PRIORITY = 100;
public static final int DEFAULT_PRIORITY = 100;
private int mPriority;
public Priority()
{
}
@XmlAttribute
public int getPriority()
{
return mPriority;
}
public void setPriority( int priority )
{
mPriority = priority;
}
public String toString()
{
return "Priority: " + mPriority;
}
@Override
public boolean matches( AliasID id )
{
return false;
}
@Override
public AliasIDType getType()
{
return AliasIDType.Priority;
}
}

View File

@@ -0,0 +1,123 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.priority;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextArea;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import module.decode.config.DecodeConfiguration;
import net.miginfocom.swing.MigLayout;
import controller.ConfigurableNode;
public class PriorityEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private PriorityNode mPriorityNode;
private JSlider mPrioritySlider;
private JLabel mPrioritySliderLabel;
public PriorityEditor( PriorityNode priorityNode )
{
mPriorityNode = priorityNode;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
add( new JLabel( "Priority" ), "span,align center" );
mPrioritySlider = new JSlider( JSlider.HORIZONTAL,
Priority.MIN_PRIORITY,
Priority.MAX_PRIORITY,
Priority.DEFAULT_PRIORITY );
mPrioritySlider.setMajorTickSpacing( 20 );
mPrioritySlider.setMinorTickSpacing( 5 );
mPrioritySlider.setPaintTicks( true );
mPrioritySlider.setLabelTable( mPrioritySlider.createStandardLabels( 20, 20 ) );
mPrioritySlider.setPaintLabels( true );
mPrioritySliderLabel = new JLabel( "Priority: " + mPrioritySlider.getValue() + " " );
mPrioritySlider.addChangeListener( new ChangeListener()
{
@Override
public void stateChanged( ChangeEvent e )
{
mPrioritySliderLabel.setText( "Priority: " + mPrioritySlider.getValue() );
}
} );
add( mPrioritySliderLabel );
add( mPrioritySlider, "wrap,grow" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( PriorityEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( PriorityEditor.this );
add( btnReset, "growx,push" );
StringBuilder sb = new StringBuilder();
sb.append( "Select a value for audio priority within the range " );
sb.append( Priority.MIN_PRIORITY );
sb.append( " and " );
sb.append( Priority.MAX_PRIORITY );
sb.append( ". Lower values indicate higher priority levels." );
JTextArea helpText = new JTextArea( sb.toString() );
helpText.setLineWrap( true );
add( helpText, "span,grow,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
mPriorityNode.getPriority().setPriority( mPrioritySlider.getValue() );
((ConfigurableNode)mPriorityNode.getParent()).sort();
mPriorityNode.save();
mPriorityNode.show();
}
else if( command.contentEquals( "Reset" ) )
{
mPrioritySlider.setValue( mPriorityNode.getPriority().getPriority() );
}
mPriorityNode.refresh();
}
}

View File

@@ -0,0 +1,86 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2015 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.priority;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasIDNode;
import alias.AliasNode;
public class PriorityNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public PriorityNode( Priority priority )
{
super( priority );
}
@Override
public JPanel getEditor()
{
return new PriorityEditor( this );
}
public Priority getPriority()
{
return (Priority)getUserObject();
}
public String toString()
{
return "Priority: " + getPriority().getPriority();
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( getPriority() );
save();
getModel().removeNodeFromParent( PriorityNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}

View File

@@ -0,0 +1,19 @@
package alias.record;
import alias.AliasID;
import alias.AliasIDType;
public class NonRecordable extends AliasID
{
@Override
public AliasIDType getType()
{
return AliasIDType.NonRecordable;
}
@Override
public boolean matches( AliasID id )
{
return false;
}
}

View File

@@ -0,0 +1,75 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.record;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import net.miginfocom.swing.MigLayout;
public class NonRecordableEditor extends JPanel implements ActionListener
{
private static final long serialVersionUID = 1L;
private NonRecordableNode mNode;
public NonRecordableEditor( NonRecordableNode node )
{
mNode = node;
initGUI();
}
private void initGUI()
{
setLayout( new MigLayout( "fill", "[left]", "[grow]" ) );
JTextArea description = new JTextArea( "Non-Recordable. Any audio where"
+ "this alias is a participant in the call will not be recorded." );
description.setLineWrap( true );
description.setBackground( getBackground() );
add( description, "growx,span" );
JButton btnSave = new JButton( "Save" );
btnSave.addActionListener( NonRecordableEditor.this );
add( btnSave, "growx,push" );
JButton btnReset = new JButton( "Reset" );
btnReset.addActionListener( NonRecordableEditor.this );
add( btnReset, "growx,push" );
}
@Override
public void actionPerformed( ActionEvent e )
{
String command = e.getActionCommand();
if( command.contentEquals( "Save" ) )
{
mNode.save();
mNode.show();
}
mNode.refresh();
}
}

View File

@@ -0,0 +1,88 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package alias.record;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import alias.AliasID;
import alias.AliasIDNode;
import alias.AliasNode;
public class NonRecordableNode extends AliasIDNode
{
private static final long serialVersionUID = 1L;
public NonRecordableNode( NonRecordable id )
{
super( id );
}
@Override
public JPanel getEditor()
{
return new NonRecordableEditor( this );
}
@Override
public String getIconPath()
{
return "images/non_recordable.png";
}
public String toString()
{
return "Non-Recordable";
}
public JPopupMenu getContextMenu()
{
JPopupMenu retVal = new JPopupMenu();
JMenuItem addSystemItem = new JMenuItem( "Delete" );
addSystemItem.addActionListener( new ActionListener()
{
@Override
public void actionPerformed( ActionEvent e )
{
int n = JOptionPane.showConfirmDialog( getModel().getTree(),
"Are you sure you want to permanently delete this node?" );
if( n == JOptionPane.YES_OPTION )
{
AliasNode parent = (AliasNode)getParent();
parent.getAlias().removeAliasID( (AliasID)getUserObject() );
save();
getModel().removeNodeFromParent( NonRecordableNode.this );
}
}
} );
retVal.add( addSystemItem );
return retVal;
}
}