sk.uniba.euromath.editor.textEditor
Class TextPieceSelectionStatusImpl

java.lang.Object
  extended by sk.uniba.euromath.editor.textEditor.TextPieceSelectionStatusImpl
All Implemented Interfaces:
ITextPieceSelectionStatus

public class TextPieceSelectionStatusImpl
extends Object
implements ITextPieceSelectionStatus

Selection status for text piece. To store intervals is used HashSet instead of bit map, because most selections are very simple - one big interval.

Author:
Tomáš Studva 24.1.2006 Martin Kollar

Constructor Summary
TextPieceSelectionStatusImpl(ITextPieceKeeper keeper)
          Constructor.
 
Method Summary
 void addSelectionInterval(Interval interval)
          Adds interval to selection.
 void clear()
          Clears the selection
 List<Interval> getSelectionIntervals()
          Returns selection that relates to this text piece.
 boolean isFullySelected()
          Test if whole text is selected.
 boolean isPartlySelected()
          Test if something is selected, but not everything
 void selectFull()
          Select whole text of keeper.
 void setSelectionIntervals(Collection<Interval> intervals)
          Sets what is selected
 void subtractSelectionInterval(Interval interval)
          Subtracts interval from selection
 void xorSelectionIntervals(Collection<Interval> intervals)
          Makes XOR with this new interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPieceSelectionStatusImpl

public TextPieceSelectionStatusImpl(ITextPieceKeeper keeper)
Constructor. Creates text selection status for text piece.

Parameters:
keeper - about associated text piece
Method Detail

clear

public void clear()
Description copied from interface: ITextPieceSelectionStatus
Clears the selection

Specified by:
clear in interface ITextPieceSelectionStatus

getSelectionIntervals

public List<Interval> getSelectionIntervals()
Description copied from interface: ITextPieceSelectionStatus
Returns selection that relates to this text piece.

Specified by:
getSelectionIntervals in interface ITextPieceSelectionStatus
Returns:
list by copy, not overlapping Intervals within text piece.

isPartlySelected

public boolean isPartlySelected()
Description copied from interface: ITextPieceSelectionStatus
Test if something is selected, but not everything

Specified by:
isPartlySelected in interface ITextPieceSelectionStatus
Returns:
true, if something is selected, but it is not fully selected

isFullySelected

public boolean isFullySelected()
Description copied from interface: ITextPieceSelectionStatus
Test if whole text is selected.

Specified by:
isFullySelected in interface ITextPieceSelectionStatus
Returns:
true, if whole ITextPieceKeeper is selected

setSelectionIntervals

public void setSelectionIntervals(Collection<Interval> intervals)
Description copied from interface: ITextPieceSelectionStatus
Sets what is selected

Specified by:
setSelectionIntervals in interface ITextPieceSelectionStatus
Parameters:
intervals - Collection of intervals, that are in range text and are not overlaping

addSelectionInterval

public void addSelectionInterval(Interval interval)
Description copied from interface: ITextPieceSelectionStatus
Adds interval to selection. After addition intervals are tidied to not overlap.

Specified by:
addSelectionInterval in interface ITextPieceSelectionStatus
Parameters:
interval - Interval to add to selection

xorSelectionIntervals

public void xorSelectionIntervals(Collection<Interval> intervals)
Description copied from interface: ITextPieceSelectionStatus
Makes XOR with this new interval

Specified by:
xorSelectionIntervals in interface ITextPieceSelectionStatus
Parameters:
intervals - Interval to XOR with others

subtractSelectionInterval

public void subtractSelectionInterval(Interval interval)
Description copied from interface: ITextPieceSelectionStatus
Subtracts interval from selection

Specified by:
subtractSelectionInterval in interface ITextPieceSelectionStatus
Parameters:
interval - Interval to subtract

selectFull

public void selectFull()
Description copied from interface: ITextPieceSelectionStatus
Select whole text of keeper.

Specified by:
selectFull in interface ITextPieceSelectionStatus


Copyright © 2003-2006 null. All Rights Reserved.