public abstract class AlignmentViewport implements AlignViewportI,
CommandListener, VamsasSource
{
+ protected ViewportPositionProps posProps;
+
protected ViewStyleI viewStyle = new ViewStyle();
/**
}
/**
- * Set the selection group for this window.
+ * Set the selection group for this window. Also sets the current alignment as
+ * the context for the group, if it does not already have one.
*
* @param sg
* - group holding references to sequences in this alignment view
public void setSelectionGroup(SequenceGroup sg)
{
selectionGroup = sg;
+ if (sg != null && sg.getContext() == null)
+ {
+ sg.setContext(alignment);
+ }
}
public void setHiddenColumns(ColumnSelection colsel)
*/
private boolean followHighlight = true;
- // TODO private with getters and setters?
- public int startRes;
+ /*private int startRes;
- public int endRes;
+ private int endRes;
- public int startSeq;
+ private int startSeq;
- public int endSeq;
+ private int endSeq;*/
/**
* Property change listener for changes in alignment
public void setViewStyle(ViewStyleI settingsForView)
{
viewStyle = new ViewStyle(settingsForView);
+ if (residueShading != null)
+ {
+ residueShading.setConservationApplied(settingsForView
+ .isConservationColourSelected());
+ }
}
@Override
this.followHighlight = b;
}
+ @Override
+ public ViewportPositionProps getPosProps()
+ {
+ return posProps;
+ }
+
+ @Override
public int getStartRes()
{
- return startRes;
+ return posProps.getStartRes();
}
@Override
public int getEndRes()
{
- return endRes;
+ return posProps.getEndRes();
}
+ @Override
public int getStartSeq()
{
- return startSeq;
+ return posProps.getStartSeq();
}
public void setStartRes(int res)
{
- this.startRes = res;
+ posProps.setStartRes(res);
+ // this.startRes = res;
}
public void setStartSeq(int seq)
{
- this.startSeq = seq;
+ posProps.setStartSeq(seq);
+ // this.startSeq = seq;
}
public void setEndRes(int res)
{
- if (res > alignment.getWidth() - 1)
+ posProps.setEndRes(res);
+ /*if (res > alignment.getWidth() - 1)
{
// log.System.out.println(" Corrected res from " + res + " to maximum " +
// (alignment.getWidth()-1));
{
res = 0;
}
- this.endRes = res;
+ this.endRes = res;*/
}
public void setEndSeq(int seq)
{
- if (seq > alignment.getHeight())
+ posProps.setEndSeq(seq);
+ /*if (seq > alignment.getHeight())
{
seq = alignment.getHeight();
}
{
seq = 0;
}
- this.endSeq = seq;
+ this.endSeq = seq;*/
}
+ @Override
public int getEndSeq()
{
- return endSeq;
+ return posProps.getEndSeq();
+ // return endSeq;
}
/**