DiagramViewer

## class DiagramViewer : public Viewer

> diagram viewer class, responsible for the contents of the drawing area.

## Inheritance:

### Public Methods

  | DiagramViewer (Config *c, DiagramWindow *w)
  virtual | ~DiagramViewer ()
  void | Initialize ()
  void | SetDiagram (Diagram *d)
  Diagram* | GetDiagram () const
  void | SetGrafport (Grafport *g)
  Buffer* | GetBuffer () const
  Grid* | GetGrid () const
  int | GetDefaultNodeType () const
  int | GetDefaultEdgeType () const
  int | GetDefaultNodeShapeType () const
  int | GetDefaultLineType () const
  bool | IsDefaultCurve () const
  void | SetDefaultNodeType (int n)
  void | SetDefaultEdgeType (int n)
  void | SetDefaultNodeShapeType (int n)
  void | SetDefaultLineType (int n)
  void | SetDefaultCurve (bool s)
  void | SetShowIndexes (bool b)
  bool | IsShowIndexes ()
  LineStyle::Type | GetDefaultNodeLineStyle () const
  LineStyle::Type | GetDefaultEdgeLineStyle () const
  void | SetDefaultNodeLineStyle (LineStyle::Type l)
  void | SetDefaultEdgeLineStyle (LineStyle::Type l)
  LineEnd::Type | GetDefaultLineEnd1 ()
  LineEnd::Type | GetDefaultLineEnd2 ()
  void | SetDefaultLineEnd1 (LineEnd::Type t)
  void | SetDefaultLineEnd2 (LineEnd::Type t)
  int | Snap (int i) const forwarding to grid object.
  void | Snap (Point *p)
  void | SetStatus (const char *msg)
  void | SetStatus (const string *msg)
  void | SetCursor (int cursor)
  void | SetSizeCursor (int cursor)
  virtual void | Draw () Draw all shapes of current view to grafport.
  virtual void | Undraw () Erase all shapes of current view from grafport.
  void | Redraw () Redraw everything including grid.
  ShapeView* | GetCurView () const return current view.
  void | DeleteAllViews ()
  unsigned int | NumberOfViews () const
  bool | AddView (ShapeView *v)
  void | SetView (ShapeView *v)
  void | UpdateView (ShapeView *v)
  bool | HasView (const string *index)
  bool | HasView (ShapeView *v)
  ShapeView* | GetView (const string *index)
  void | CheckShapes () Check all shapes in all views.
  void | WriteShapes (OutputFile *f) write all shapes from all views to ofile.
  void | WriteSelection (OutputFile *f) write all selected shapes from current view to ofile.
  void | Select (int x, int y) perform the button1 functions (includes creating and moving shapes).
  void | Adjust (int x, int y) Perform the 2nd button function: (de)selection.
  Command* | Drag (int x, int y) drag shapes and handles of line-segments.
  Command* | Connect (int x, int y) create an edge between nodes.
  void | MovingPointer (int x, int y) change cursor to show the possible command (resize, move or edit).
  void | KeyTyped (int x, int y, int key) start textmode, or (if in textmode) handle key. (x,y) is position.
  void | TextModeOff () stop being in editing mode.
  void | DeselectAll () deselect all shapes in all views in the viewer.
  GShape* | GetShape (Subject *subject) return first shape from shapes having given subject (in any view).
  void | GetShapes (Subject *subject, List<GShape *> *shapes) put in shapes all shapes from all views having given subject.
  virtual void | Cut () Cut subjects/shapes cmd from current view to buffer.
  virtual void | Copy () Copy subjects/shapes cmd from current view to buffer.
  virtual void | Paste () Paste from buffer to current view and graph.
  virtual void | Duplicate () Node shapes in selection are duplicated, pasted in current view.
  virtual void | AlignNodeShapes () Align selection in current view according to given align type.
  virtual void | AlignNodes (NodeAlign::Type alignment) Align selection in current view according to given align type.
  virtual void | UpdateCurve () Convert selected curves from/to selected segmented lines.
  virtual void | UpdateTextUnderline () Set/Unset the text underlining of the names of the selected shapes.
  virtual void | FindAll (const string *s, bool sens, bool substr, bool nameOnly) select all shapes having string s (sens case sensitive).
  virtual void | FindNext (const string *s, bool sens, bool substr, bool nameOnly) select next shape having string s, and set cursor before it.
  virtual void | ReplaceNext (const string *s1, const string *s2, bool sens, bool substr, bool nameOnly) replace string in next shape in current view.
  virtual void | ReplaceAll (const string *s1, const string *s2, bool sens, bool substr, bool nameOnly) replace all strings in current view.
  virtual void | Annotate () edit annotation of first selected subject in current view.
  virtual void | DeleteShapes () Delete shapes (and event. subjects) from selection.
  virtual void | DeleteAll () All shapes (and subjects) are deleted from current view.
  virtual void | SameSize () makes the size of selection shapes equal to size of the first.
  virtual void | MoveAllShapes (Document::MoveType t) move all shapes in current view according to move type.
  virtual void | SelectAll () select all shapes in the current view.
  void | UpdateTextAlignmentSelection (TextAlign::Type a) update text alignment of selection in current view.
  void | UpdateText (TextShape *t, const string *newtext, const string *oldtext) update text of textshape.
  void | UpdateLineWidthSelection (unsigned i) update line width of selected shapes.
  void | UpdateLineStyleSelection (LineStyle::Type s) update line style of selected shapes.
  void | UpdateFontSelection (int family, int style, int size) update the fonts of selected shapes.
  void | UpdateLineColorSelection (const string *color) update the colors of the lines of the selected shapes.
  void | UpdateTextColorSelection (const string *color) update the colors of the texts of the selected shapes.
  void | UpdateFillColorSelection (const string *color, FillStyle::Type f) update the fill colors of the selected shapes.
  void | CalcSizeElements (Point &topLeft, Point &bottomRight) calculate size of shapes in current view.
  void | CalcSizeSelection (Point &topLeft, Point &bottomRight) calc size of selection in current view.
  void | CalcSizeShapes (List<GShape *> *shapes, Point &topLeft, Point &bottomRight) calculate covered area of shapes in grafport.
  void | ShapePositionUpdate (GShape *shape) for each line connecting shape, position is propagated.
  void | UpdateDuplicationMarks (List<Subject *> *s) Update the duplication marks of shapes of given subjects.
  void | UpdateDuplicationMarks (Subject *s) Update the duplication marks of shapes of given subject.
  void | UpdateMoveShapes (List<GShape *> *shapes, const Point *delta) shapes are moved delta and result is propagated to drawing area.
  void | MoveShapes (List<GShape *> *shapes, const Point *delta) all shapes are moved delta (result not propagated).
  virtual void | UpdateNodeShapeType (int) convert selected node shapes to given code
  void | ConvertNodeShapes () convert selected node shapes.
  virtual void | DeleteSubjects ()
  void | SetIndexes (bool b)
  void | Reindex (List<Node *> *nodes)
  virtual void | ZoomIn ()
  void | ZoomOut ()
  void | TopLevel ()
  LineEndDialog* | GetLineEndDialog ()
  void | UpdateLineEnd ()
  void | ShowDefaultLineEnd ()
  void | UpdateLineEndSelection (LineEnd::Type e1, LineEnd::Type e2)
  NodeAlignmentDialog* | GetNodeAlignmentDialog ()
  void | ShowDefaultNodeAlignment ()
  NodeShapeDialog* | GetNodeShapeDialog ()
  void | ShowDefaultNodeShape ()

### Protected Methods

  List <ShapeView *> * | GetViews () const
  void | EmptySelectionMessage () error message because of empty selection.
  void | EmptyShapesMessage () error message because there are no shapes.

### Inherited from Viewer:

### Public Fields

static const int MIN_LINE_WIDTH
static const int MAX_LINE_WIDTH

### Public Methods

Scaler* GetScaler() const
Command* GetLastCmd()
DrawWindow* GetMainWindow() const
Grafport* GetGrafport() const
Printer* GetPrinter() const
void SetPrinter(Printer *p)
NToggleListDialog* GetLineWidthDialog()
NToggleListDialog* GetLineStyleDialog()
NToggleListDialog* GetTextAlignmentDialog()
FontChooserDialog* GetFontChooserDialog()
FileSelectionDialog* GetPrintFileSelectionDialog()
ColorChooserDialog* GetColorChooserDialog()
int Scale(int x) const
Point Scale(const Point *p) const
int ScaleCorrect(int x) const
Point ScaleCorrect(const Point *p) const
void Undo()
void Redo()
void Refresh()
virtual void Activate()
virtual void Deactivate()
void SetDefaultLineWidth(unsigned d)
int GetDefaultLineWidth()
void UpdateLineWidth()
void DefaultLineWidth()
void ShowDefaultLineWidth()
void ShowConfigLineWidth()
void SetDefaultLineStyle(LineStyle::Type l)
LineStyle::Type GetDefaultLineStyle()
void UpdateLineStyle()
void DefaultLineStyle()
void ShowDefaultLineStyle()
void ShowConfigLineStyle()
void SetDefaultLineColor(const string *s)
const string* GetDefaultLineColor()
void SetDefaultTextColor(const string *s)
const string* GetDefaultTextColor()
void SetDefaultFillColor(const string *s)
const string* GetDefaultFillColor()
FillStyle::Type GetDefaultFillStyle() const
void SetDefaultFillStyle(FillStyle::Type l)
void UpdateLineColor()
void DefaultLineColor()
void ShowDefaultLineColor()
void ShowConfigLineColor()
void UpdateTextColor()
void DefaultTextColor()
void ShowDefaultTextColor()
void ShowConfigTextColor()
void UpdateFillColor()
void DefaultFillColor()
void ShowDefaultFillColor()
void ShowConfigFillColor()
XFont* GetDefaultFont() const
void SetDefaultFontAttributes(int f, int s, int p)
virtual void SetDefaultFont(XFont *ft)
void UpdateFont()
void DefaultFont()
void ShowDefaultFont()
void ShowConfigFont()
XFont* GetFont(int family, int style, int size)
XFont* GetFont(const char *description)
void UpdateTextAlignment()
void DefaultTextAlignment()
void ShowDefaultTextAlignment()
void ShowConfigTextAlignment()
TextAlign::Type GetDefaultTextAlignment() const
void SetDefaultTextAlignment(TextAlign::Type a)
void EditText(int key)
bool IsAutoResize() const
void SetAutoResize(bool s)
bool IsInlineEdit() const
void SetInlineEdit(bool s)
bool IsPasting() const
void SetPasting(bool b)
bool IsZigZag() const
void SetZigZag(bool b)
bool IsEditing() const
void DoubleClick()
void DoFunctionKey(int)
void NewCommand(Command *newCmd)
void AbortCommand()
void ExecuteCommand()
void UndoCommand()
void RedoCommand()
void DeleteCommands()
void GetPageSize(double &width, double &height)
void Save(OutputFile *f)
bool Load(InputFile *f, double format)
bool Check(InputFile *f, double format)

### Protected Methods

void ClearGrafport()
InlineEditor* GetInlineEditor() const
void SetInlineEditor(InlineEditor *i)
void SetEditing(bool b)

## Documentation

> diagram viewer class, responsible for the contents of the drawing area.

`DiagramViewer(Config *c, DiagramWindow *w)`

`virtual ~DiagramViewer()`

`void Initialize()`

`void SetDiagram(Diagram *d)`

`Diagram* GetDiagram() const`

`void SetGrafport(Grafport *g)`

`Buffer* GetBuffer() const`

`Grid* GetGrid() const`

`int GetDefaultNodeType() const`

`int GetDefaultEdgeType() const`

`int GetDefaultNodeShapeType() const`

`int GetDefaultLineType() const`

`bool IsDefaultCurve() const`

`void SetDefaultNodeType(int n)`

`void SetDefaultEdgeType(int n)`

`void SetDefaultNodeShapeType(int n)`

`void SetDefaultLineType(int n)`

`void SetDefaultCurve(bool s)`

`void SetShowIndexes(bool b)`

`bool IsShowIndexes()`

`LineStyle::Type GetDefaultNodeLineStyle() const`

`LineStyle::Type GetDefaultEdgeLineStyle() const`

`void SetDefaultNodeLineStyle(LineStyle::Type l)`

`void SetDefaultEdgeLineStyle(LineStyle::Type l)`

`LineEnd::Type GetDefaultLineEnd1()`

`LineEnd::Type GetDefaultLineEnd2()`

`void SetDefaultLineEnd1(LineEnd::Type t)`

`void SetDefaultLineEnd2(LineEnd::Type t)`

`int Snap(int i) const`
  forwarding to grid object.

`void Snap(Point *p)`

`void SetStatus(const char *msg)`

`void SetStatus(const string *msg)`

`void SetCursor(int cursor)`

`void SetSizeCursor(int cursor)`

`virtual void Draw()`
  Draw all shapes of current view to grafport.

`virtual void Undraw()`
  Erase all shapes of current view from grafport.

`void Redraw()`
  Redraw everything including grid.

`ShapeView* GetCurView() const`
  return current view.

`void DeleteAllViews()`

`unsigned int NumberOfViews() const`

`bool AddView(ShapeView *v)`

`void SetView(ShapeView *v)`

`void UpdateView(ShapeView *v)`

`bool HasView(const string *index)`

`bool HasView(ShapeView *v)`

`ShapeView* GetView(const string *index)`

`void CheckShapes()`
  Check all shapes in all views.

`void WriteShapes(OutputFile *f)`
  write all shapes from all views to ofile.

`void WriteSelection(OutputFile *f)`
  write all selected shapes from current view to ofile.

`void Select(int x, int y)`
  perform the button1 functions (includes creating and moving shapes).

`void Adjust(int x, int y)`
  Perform the 2nd button function: (de)selection.

`Command* Drag(int x, int y)`
  drag shapes and handles of line-segments.

`Command* Connect(int x, int y)`
  create an edge between nodes.

`void MovingPointer(int x, int y)`
  change cursor to show the possible command (resize, move or edit).

`void KeyTyped(int x, int y, int key)`
  start textmode, or (if in textmode) handle key. (x,y) is position.

`void TextModeOff()`
  stop being in editing mode.

`void DeselectAll()`
  deselect all shapes in all views in the viewer.

`GShape* GetShape(Subject *subject)`
  return first shape from shapes having given subject (in any view).

`void GetShapes(Subject *subject, List<GShape *> *shapes)`
  put in shapes all shapes from all views having given subject.

`virtual void Cut()`
  Cut subjects/shapes cmd from current view to buffer.

`virtual void Copy()`
  Copy subjects/shapes cmd from current view to buffer.

`virtual void Paste()`
  Paste from buffer to current view and graph.

`virtual void Duplicate()`
  Node shapes in selection are duplicated, pasted in current view.

`virtual void AlignNodeShapes()`
  Align selection in current view according to given align type.

`virtual void AlignNodes(NodeAlign::Type alignment)`
  Align selection in current view according to given align type.

`virtual void UpdateCurve()`
  Convert selected curves from/to selected segmented lines.

`virtual void UpdateTextUnderline()`
  Set/Unset the text underlining of the names of the selected shapes.

`virtual void FindAll(const string *s, bool sens, bool substr, bool nameOnly)`
  select all shapes having string s (sens case sensitive).

`virtual void FindNext(const string *s, bool sens, bool substr, bool nameOnly)`
  select next shape having string s, and set cursor before it.

`virtual void ReplaceNext(const string *s1, const string *s2, bool sens, bool substr, bool nameOnly)`
  replace string in next shape in current view.

`virtual void ReplaceAll(const string *s1, const string *s2, bool sens, bool substr, bool nameOnly)`
  replace all strings in current view.

`virtual void Annotate()`
  edit annotation of first selected subject in current view.

`virtual void DeleteShapes()`
  Delete shapes (and event. subjects) from selection.

`virtual void DeleteAll()`
  All shapes (and subjects) are deleted from current view.

`virtual void SameSize()`
  makes the size of selection shapes equal to size of the first.

`virtual void MoveAllShapes(Document::MoveType t)`
  move all shapes in current view according to move type.

`virtual void SelectAll()`
  select all shapes in the current view.

`void UpdateTextAlignmentSelection(TextAlign::Type a)`
  update text alignment of selection in current view.

`void UpdateText(TextShape *t, const string *newtext, const string *oldtext)`
  update text of textshape.

`void UpdateLineWidthSelection(unsigned i)`
  update line width of selected shapes.

`void UpdateLineStyleSelection(LineStyle::Type s)`
  update line style of selected shapes.

`void UpdateFontSelection(int family, int style, int size)`
  update the fonts of selected shapes.

`void UpdateLineColorSelection(const string *color)`
  update the colors of the lines of the selected shapes.

`void UpdateTextColorSelection(const string *color)`
  update the colors of the texts of the selected shapes.

`void UpdateFillColorSelection(const string *color, FillStyle::Type f)`
  update the fill colors of the selected shapes.

`void CalcSizeElements(Point &topLeft, Point &bottomRight)`
  calculate size of shapes in current view.

`void CalcSizeSelection(Point &topLeft, Point &bottomRight)`
  calc size of selection in current view.

`void CalcSizeShapes(List<GShape *> *shapes, Point &topLeft, Point &bottomRight)`
  calculate covered area of shapes in grafport.

`void ShapePositionUpdate(GShape *shape)`
  for each line connecting shape, position is propagated.

`void UpdateDuplicationMarks(List<Subject *> *s)`
  Update the duplication marks of shapes of given subjects.

`void UpdateDuplicationMarks(Subject *s)`
  Update the duplication marks of shapes of given subject.

`void UpdateMoveShapes(List<GShape *> *shapes, const Point *delta)`
  shapes are moved delta and result is propagated to drawing area.

`void MoveShapes(List<GShape *> *shapes, const Point *delta)`
  all shapes are moved delta (result not propagated).

`virtual void UpdateNodeShapeType(int)`
  convert selected node shapes to given code

`void ConvertNodeShapes()`
  convert selected node shapes.

`virtual void DeleteSubjects()`

`void SetIndexes(bool b)`

`void Reindex(List<Node *> *nodes)`

`virtual void ZoomIn()`

`void ZoomOut()`

`void TopLevel()`

`LineEndDialog* GetLineEndDialog()`

`void UpdateLineEnd()`

`void ShowDefaultLineEnd()`

`void UpdateLineEndSelection(LineEnd::Type e1, LineEnd::Type e2)`

`NodeAlignmentDialog* GetNodeAlignmentDialog()`

`void ShowDefaultNodeAlignment()`

`NodeShapeDialog* GetNodeShapeDialog()`

`void ShowDefaultNodeShape()`

`List <ShapeView *> * GetViews() const`

`void EmptySelectionMessage()`
  error message because of empty selection.

`void EmptyShapesMessage()`
  error message because there are no shapes.

Direct child classes:
  TRViewer
  STViewer
  SNViewer
  RPViewer
  PSViewer
  GDViewer
  ERViewer
  DFViewer
  CPViewer
  ATViewer

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de