Using YCAD To display floor plans without the toolbar
Brought to you by:
ekarlo
Original ID 963813 by djshiow
I would like to use YCAD to only display maps. I tried
using the YcadvPane and it displays the maps real
great. but the tool bar always come along.. I would like
to use some functionality provided in the tool bar (ie.
zoom, span left , right ) but I would like to do it via my
own interface is there anyway to do that.
I would really appreciate your response. Please mail me
at djshiow@yahoo.com if there is any solution. Thanks
in advance
Dungjit Shiowattana
Hello -
This is Ed Karlo, developer of the Ycad library.
I'm impressed that you were able to make use of the
YcadvPane module. The YcadvPane and all of the lib.java
and BeanInfo.java classes were an unfinished attempt to
create JavaBeans suitable for use in a drag-and-drop IDE. I
had some moderate success but never figured out a good
way to get the input beans connected to the viewer pane in
a good way. I worked on the JavaBeans for awhile and then
moved to other things.
There is a parameter to control the toolbar - "toolbar=false".
I call the existing toolbar the "default simple toolbar". I
intended to make the toolbar "pluggable" but there is no code
right now to handle this. You can turn the toolbar off (as
above) and write toolbar code "outside" of the viewer. The
YxxfDrwViewHander module is the master controller for the
viewer. It listens for events from the toolbar to control the
view and listens for events from the drawing. The view
handler controls all views and will return the view Panel
reference "getViewer()" for developer use. The view handler
has methods (used by the toolbar) to change the drawing
view. See the view handler methods that start
with "commandViewHandler_toolbar_". These methods are
the same ones used by the toolbar. You can call them from
your own custom toolbar. The view handler is the "vhandler"
reference in YcadvPane.
I recently did a project that used the Ycad viewer as a
component in a larger Swing app. I did not use the
YcadvPane module but instead duplicated the code in Ycadv.
Your solution to use the YcadvPane is a good one. I
considered using it but did not.
Also, I hope to have a new release out in the next 2-3
weeks. The most significant change is the addition of a
Swing version of the viewer. The AWT version (the
YxxfDrw) modules are getting a bit long in the tooth. The
new Swing version (the YxxfJDrw) modules make use of
Swing features like double buffering. The "YxxfPrt*" modules
allow rendering the drawing to an arbitrary Graphics object.
Other changes include:
The toolbar functions (zoom, pan, etc.) now work in paper
space.
The new Swing viewer is called "YcadvJ". The code is
currently in CVS on sourceforge. It is still under development
but it is working well enough to use. You can check the
latest version out of the CVS repository. To continue your
YcadvPane usage one could create a new module called
YcadvJPane.
If you make any changes to the Ycad code you can send
them to me and I will incorporate them into the code base.
Let me know if this helps.
Ed