[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fenfire-dev] NodeTypeManager
From: |
Asko Soukka |
Subject: |
[Fenfire-dev] NodeTypeManager |
Date: |
Fri, 5 Sep 2003 15:46:04 +0300 (EEST) |
Hi,
Not yet PEGging, but writing down thoughts... sorry for bad English. I got
a little hurry.
I wanted to make "import PDF/PS" work also for images, for PNGs at first.
The beginning was easy: create ImageScrollBlock, make Storm store
ImageSpans (modified SpanSerializer and SpanReader) and
ImageScrollBlockImager. The ImageScrollBlockImager was actually already
documented and MuxImageSpanFactory existed to make it work parallel with
PageScrollBlockImager.
Then it got complicated.
The current Fenfire and FenPDF code was written to work especially with
two NodeTypes: PageScrollBlock and Canvas. Instead adding everywhere a
third new node type, Tuomas suggested to abstract current code to work
with any node type. At least TTConnector and TransclusionConnector should
handle nodes through that abstraction.
Today resulted an idea of new interface, which would provide
getNodeType(Object) method. I suppose, it would be::
public AbstractNodeType2D getNodeType(Object o);
The interface would be implemented only once in an applitude. Do you have
ideas for naming the interface. I came up only with "NodeTypeManager",
implemented as "FenPDFNodeTypeManager" in FenPDF.
Then Tuomas proposed that also abstracting keybindings to depend on
type of the main node should be resolved at the same time. Well, I'm not
yet familiar enough with FenPDF event handling to resolve that, but it
would affect the place NodeTypeManager could be implemented.
This far, org.fenfire.fenpdf.appearance.views.Views() looks good, since
the creation FenPDF spesific nodetypes, Connectors and buoymanager is
located there. It feels natural to create the class implementing
getNodeType() there and pass it to Connectors.
Preliminarily it looks at least for me that FenPDF's Views class could
handle also nodetype dependend keybindings. Views get a current
EventHandler as constructor parameter and passes it on to BuoyManager
constructor. Then Views.setFocus() is called always to set the new
MainNode. I guess, there we could check the type of the new mainnode and
fetch it's keybindings from NodeTypeManager (getEventHandler()?).
Please, comment.
And have a nice weekend.
--
Asko Soukka <address@hidden>
<http://www.iki.fi/asko.soukka/>
- [Fenfire-dev] NodeTypeManager,
Asko Soukka <=