/[gzz]/gzz/gfx/demo/viewtest.py
ViewVC logotype

Diff of /gzz/gfx/demo/viewtest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by humppake, Tue Nov 19 08:50:59 2002 UTC revision 1.4 by humppake, Fri Nov 22 03:59:22 2002 UTC
# Line 31  from java.awt import Font Line 31  from java.awt import Font
31  class TestViewContext(ViewContext):  class TestViewContext(ViewContext):
32      def __init__(self):      def __init__(self):
33          self.space = ModularSpace(*tools.spaceArgList())          self.space = ModularSpace(*tools.spaceArgList())
34          self.style = GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10)          self.style = GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 14)
35    
36          self.d = [self.space.getDim(d_1),          self.d = [self.space.getDim(d_1),
37                    self.space.getDim(d_2),                    self.space.getDim(d_2),
# Line 77  class ViewScene: Line 77  class ViewScene:
77          putnoc(vs, background(self.bgcolor))          putnoc(vs, background(self.bgcolor))
78    
79          context = TestViewContext()          context = TestViewContext()
80          contentBox = vs.orthoBoxCS(0, "content", 0, 100, 100, 1, 1,          contentBox = vs.orthoBoxCS(0, "content", 0, 0, 0, 1, 1,
81                                     self.size.width, self.size.height)                                     self.size.width, self.size.height)
82          context.v.render(vs, contentBox, context)          context.v.render(vs, contentBox, context)
83    
# Line 95  class TestView (View.NamedView): Line 95  class TestView (View.NamedView):
95    
96      def render(self, intoVS, intoCS, context):      def render(self, intoVS, intoCS, context):
97          c = context.getAccursed()          c = context.getAccursed()
98          box = intoVS.orthoBoxCS(intoCS, c, 0, 0, 0, 1, 1, 100, 100)          box = intoVS.orthoBoxCS(intoCS, "cell", 0, 100, 100, 5, 5, 100, 100)
99          cv = context.getCellView()          cv = context.getCellView()
100          cv.place(c, intoVS, box, context)          cv.place(c, intoVS, box, context)
101          print c.t()          print c.t()

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26