/** * Gets the global identifier for the panel in the south. * @return the identifier */ public String getSouthIdentifier(){ return getSouthIdentifier( uniqueId ); }
/** * Gets the global identifier for the panel in the south. * @return the identifier */ public String getSouthIdentifier(){ return getSouthIdentifier( uniqueId ); }
/** * Gets the station that is shown at the south side of the content-area. * @return the minimize-area at the bottom side */ public CMinimizePerspective getSouth(){ return (CMinimizePerspective)perspective.getStation( CContentArea.getSouthIdentifier( id )); }
/** * Gets the station that is shown at the south side of the content-area. * @return the minimize-area at the bottom side */ public CMinimizePerspective getSouth(){ return (CMinimizePerspective)perspective.getStation( CContentArea.getSouthIdentifier( id )); }
/** * Ensures the uniqueness of the identifier <code>uniqueId</code>. Throws * various exceptions if the id is not unique. * @param uniqueId the id that might be unique * @param adding the station that is about to be added */ private void checkStationIdentifierUniqueness( String uniqueId, CStation<?> adding ){ if( uniqueId == null ) throw new NullPointerException( "uniqueId must not be null" ); if( CContentArea.getCenterIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getEastIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getWestIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getSouthIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getNorthIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); for( CStation<?> station : stations ){ if( station.getUniqueId().equals( uniqueId )){ if( station == adding ){ throw new IllegalArgumentException( "The station has already been registered" ); } throw new IllegalArgumentException( "There exists already a station with id: " + uniqueId ); } } }
/** * Ensures the uniqueness of the identifier <code>uniqueId</code>. Throws * various exceptions if the id is not unique. * @param uniqueId the id that might be unique * @param adding the station that is about to be added */ private void checkStationIdentifierUniqueness( String uniqueId, CStation<?> adding ){ if( uniqueId == null ) throw new NullPointerException( "uniqueId must not be null" ); if( CContentArea.getCenterIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getEastIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getWestIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getSouthIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); if( CContentArea.getNorthIdentifier( CControl.CONTENT_AREA_STATIONS_ID ).equals( uniqueId ) ) throw new IllegalArgumentException( "The id " + uniqueId + " is reserved for special purposes" ); for( CStation<?> station : stations ){ if( station.getUniqueId().equals( uniqueId )){ if( station == adding ){ throw new IllegalArgumentException( "The station has already been registered" ); } throw new IllegalArgumentException( "There exists already a station with id: " + uniqueId ); } } }
@Override public String findRoot(){ CContentArea center = parent.getContentArea(); String id; if( center == null ) id = CControl.CONTENT_AREA_STATIONS_ID; else id = center.getUniqueId(); switch( side ){ case NORTH: return CContentArea.getNorthIdentifier( id ); case SOUTH: return CContentArea.getSouthIdentifier( id ); case EAST: return CContentArea.getEastIdentifier( id ); case WEST: return CContentArea.getWestIdentifier( id ); default: return null; } }
@Override public String findRoot(){ CContentArea center = parent.getContentArea(); String id; if( center == null ) id = CControl.CONTENT_AREA_STATIONS_ID; else id = center.getUniqueId(); switch( side ){ case NORTH: return CContentArea.getNorthIdentifier( id ); case SOUTH: return CContentArea.getSouthIdentifier( id ); case EAST: return CContentArea.getEastIdentifier( id ); case WEST: return CContentArea.getWestIdentifier( id ); default: return null; } }
String south = CContentArea.getSouthIdentifier( id ); String east = CContentArea.getEastIdentifier( id ); String west = CContentArea.getWestIdentifier( id );
String south = CContentArea.getSouthIdentifier( id ); String east = CContentArea.getEastIdentifier( id ); String west = CContentArea.getWestIdentifier( id );
/** * Creates a new content area. * @param control the control for which this area will be used * @param uniqueId a unique identifier of this center */ public CContentArea( CControl control, String uniqueId ){ this.control = control; this.uniqueId = uniqueId; CBaseLocation base = new CBaseLocation( this ); center = new CenterStation( getCenterIdentifier(), base.normal() ); north = new MinimizeStation( getNorthIdentifier(), new CMinimizedLocation( base, Side.NORTH ) ); south = new MinimizeStation( getSouthIdentifier(), new CMinimizedLocation( base, Side.SOUTH ) ); east = new MinimizeStation( getEastIdentifier(), new CMinimizedLocation( base, Side.EAST ) ); west = new MinimizeStation( getWestIdentifier(), new CMinimizedLocation( base, Side.WEST ) ); center.getStation().setExpandOnDoubleclick( false ); north.setDirection( Direction.SOUTH ); south.setDirection( Direction.NORTH ); east.setDirection( Direction.WEST ); west.setDirection( Direction.EAST ); setLayout( new BorderLayout() ); add( center.getStation(), BorderLayout.CENTER ); add( north, BorderLayout.NORTH ); add( south, BorderLayout.SOUTH ); add( east, BorderLayout.EAST ); add( west, BorderLayout.WEST ); stations = new CStation[]{ north, south, east, west, center }; }
/** * Creates a new content area. * @param control the control for which this area will be used * @param uniqueId a unique identifier of this center */ public CContentArea( CControl control, String uniqueId ){ this.control = control; this.uniqueId = uniqueId; CBaseLocation base = new CBaseLocation( this ); center = new CenterStation( getCenterIdentifier(), base.normal() ); north = new MinimizeStation( getNorthIdentifier(), new CMinimizedLocation( base, Side.NORTH ) ); south = new MinimizeStation( getSouthIdentifier(), new CMinimizedLocation( base, Side.SOUTH ) ); east = new MinimizeStation( getEastIdentifier(), new CMinimizedLocation( base, Side.EAST ) ); west = new MinimizeStation( getWestIdentifier(), new CMinimizedLocation( base, Side.WEST ) ); center.getStation().setExpandOnDoubleclick( false ); north.setDirection( Direction.SOUTH ); south.setDirection( Direction.NORTH ); east.setDirection( Direction.WEST ); west.setDirection( Direction.EAST ); setLayout( new BorderLayout() ); add( center.getStation(), BorderLayout.CENTER ); add( north, BorderLayout.NORTH ); add( south, BorderLayout.SOUTH ); add( east, BorderLayout.EAST ); add( west, BorderLayout.WEST ); stations = new CStation[]{ north, south, east, west, center }; }