1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 
14 //
15 //
16 //
17 
18 #ifndef _VPEAnnotator_h
19 #define _VPEAnnotator_h
20 
21 #include <X11/Intrinsic.h>
22 
23 #include "LabelDecorator.h"
24 #if WORKSPACE_PAGES
25 #include "GroupedObject.h"
26 #endif
27 
28 class Dictionary;
29 
30 #define ClassVPEAnnotator	"VPEAnnotator"
31 
32 #if WORKSPACE_PAGES
33 class VPEAnnotator : public LabelDecorator, public GroupedObject
34 #else
35 class VPEAnnotator : public LabelDecorator
36 #endif
37 {
38 
39   // P R I V A T E   P R I V A T E   P R I V A T E
40   // P R I V A T E   P R I V A T E   P R I V A T E
41   private:
42     static boolean VPEAnnotatorClassInitialized;
43 
44     // D R A G - N - D R O P
45     // D R A G - N - D R O P
46     static Dictionary *DragTypeDictionary;
47 
48   // P R O T E C T E D   P R O T E C T E D   P R O T E C T E D
49   // P R O T E C T E D   P R O T E C T E D   P R O T E C T E D
50   protected:
51     static String 	   DefaultResources[];
52     static Widget          DragIcon;
53     static boolean         DragDictionaryInitialized;
54     static  void           PixelToRGB(Widget, Pixel, float *, float *, float *);
55 
56     virtual void           completeDecorativePart();
57 
58     const char*		   getPostScriptFont();
59 
60     //
61     // There are 2 constructors - 1 public, 1 protected - because this class
62     // can be instantiated or subclassed.
63     //
64     VPEAnnotator(boolean developerStyle, const char *name);
65 
resizeOnUpdate()66     virtual boolean resizeOnUpdate() { return TRUE; }
requiresLineReroutingOnResize()67     virtual boolean requiresLineReroutingOnResize() { return TRUE; }
68 
69     Base* layout_information;
70 
71   // P U B L I C   P U B L I C   P U B L I C
72   // P U B L I C   P U B L I C   P U B L I C
73   public:
74     static    Decorator*     AllocateDecorator (boolean devStyle);
75     virtual   void	     openDefaultWindow();
76     virtual   boolean 	     printPostScriptPage(FILE *f);
77 
78 #if WORKSPACE_PAGES
getNetwork()79     virtual   Network*	     getNetwork() { return this->LabelDecorator::getNetwork(); }
80 
81     // C O N T R O L   P A N E L   C O M M E N T   F U N C T I O N S
82     // C O N T R O L   P A N E L   C O M M E N T   F U N C T I O N S
83     virtual   boolean	     printComment (FILE *f);
84     virtual   boolean	     parseComment (const char *comment,
85 				const char *filename, int line);
86 #endif
87 
88     //
89     // FIXME
90     // When you use the SetAnnotatorTextDialog to make new text, a large change
91     // in size of the VPEAnnotator makes hash out of the line routing.
92     // At this level it's really not nice to use knowledge of lines.
93     // Rather than change line routing code, I'll just reroute the lines
94     // after getting new text.
95     //
96     virtual void    postTextGrowthWork();
97 
getDragDictionary()98     virtual Dictionary* getDragDictionary() { return VPEAnnotator::DragTypeDictionary; }
99 
100     //
101     // On behalf of automatic graph layout...
102     //
103     void setLayoutInformation (Base* info);
getLayoutInformation()104     Base* getLayoutInformation () { return this->layout_information; }
105 
106     // T H E   T H I N G S   W E   U S E   A L L   T H E   T I M E
107     // T H E   T H I N G S   W E   U S E   A L L   T H E   T I M E
108     // T H E   T H I N G S   W E   U S E   A L L   T H E   T I M E
109     virtual   void initialize();
110     	  	   VPEAnnotator(boolean developerStyle =TRUE);
111     	  	  ~VPEAnnotator();
getClassName()112     const    char* getClassName() { return ClassVPEAnnotator; }
113     virtual  boolean isA(Symbol classname);
114 };
115 
116 
117 #endif // _VPEAnnotator_h
118