[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob doc/pegboard/buoydesign--tjl/peg.rst org...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob doc/pegboard/buoydesign--tjl/peg.rst org... |
Date: |
Sat, 09 Aug 2003 07:15:51 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/08/09 07:15:50
Modified files:
doc/pegboard/buoydesign--tjl: peg.rst
org/nongnu/libvob/buoy: BuoyGeometer.java
org/nongnu/libvob/buoy/impl: RatioMainGeometer.java
vob/buoy : buoymanager.py
Added files:
org/nongnu/libvob/buoy: BuoySizer.java
org/nongnu/libvob/buoy/impl: AspectBuoySizer.java
BuoyOnCircleGeometer.java
RatioBuoyOnCircleGeometer.java
Log message:
More buoy flexibility design
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/buoydesign--tjl/peg.rst.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/BuoySizer.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/BuoyGeometer.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/impl/AspectBuoySizer.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/impl/BuoyOnCircleGeometer.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/impl/RatioBuoyOnCircleGeometer.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/buoy/buoymanager.py.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
Patches:
Index: libvob/doc/pegboard/buoydesign--tjl/peg.rst
diff -u libvob/doc/pegboard/buoydesign--tjl/peg.rst:1.4
libvob/doc/pegboard/buoydesign--tjl/peg.rst:1.5
--- libvob/doc/pegboard/buoydesign--tjl/peg.rst:1.4 Fri Aug 8 12:30:08 2003
+++ libvob/doc/pegboard/buoydesign--tjl/peg.rst Sat Aug 9 07:15:50 2003
@@ -3,8 +3,8 @@
=============================================================
:Author: Tuomas J. Lukka
-:Last-Modified: $Date: 2003/08/08 16:30:08 $
-:Revision: $Revision: 1.4 $
+:Last-Modified: $Date: 2003/08/09 11:15:50 $
+:Revision: $Revision: 1.5 $
:Status: Incomplete
This PEG attempts to define a flexible framework for FenPDF
@@ -321,15 +321,41 @@
* @param into The matching parent and parent, giving the rectangle in
* which the whole buoyview and mainview are placed.
* @param anchor The coordinate system of the anchor, or -1 if not
applicable.
+ * @param direction 1 for right, -1 for left.
* @param key The key to use for the returned coordinate system
* in into. There may be others in between.
- * @param w,h The size requested for the buoy.
+ * @param index The index of the buoy (counted from the anchor)
+ * @param total The total number of buoys from the anchor
+ * (might be inaccurate)
+ * @param w,h The size the buoy box should be closest
+ * to the focus.
+ * @param scale The scale that should be applied to the w, h at
+ * focus
+ *
*/
- int buoyCS(VobScene vs, int into, int anchor, Object key, float w,
float h);
+ int buoyCS(VobScene vs, int into, int anchor,
+ int direction,
+ Object key,
+ int index, int total,
+ float w, float h, float scale);
}
+Before the previous interface is called,
+the buoy size is found out from the buoy sizer interface::
+ public interface BuoySizer {
+ /** Get the size and scale
+ * a buoy should be shown at (at its maximum,
+ * nearest to the focus),
+ * @param w The pixel width desired by the buoy
+ * @param h The pixel height desired by the buoy
+ * @param whout The output width and height
+ * @return The scale to use (width and height are *before*
+ * scaling, i.e. (400,400) and .5 means real size (200,200)
+ */
+ float getBuoySize(float w, float h, float[] whout);
+ }
Index: libvob/org/nongnu/libvob/buoy/BuoyGeometer.java
diff -u libvob/org/nongnu/libvob/buoy/BuoyGeometer.java:1.1
libvob/org/nongnu/libvob/buoy/BuoyGeometer.java:1.2
--- libvob/org/nongnu/libvob/buoy/BuoyGeometer.java:1.1 Fri Aug 8 10:51:47 2003
+++ libvob/org/nongnu/libvob/buoy/BuoyGeometer.java Sat Aug 9 07:15:50 2003
@@ -1,9 +1,15 @@
// (c) Tuomas J. Lukka
package org.nongnu.libvob.buoy;
+import org.nongnu.libvob.VobScene;
/** An interface for objects that determine the size and placement
* of buoys in a buoy system.
+ * <p>
+ * Objects implementing this interface may have some state:
+ * before calling buoyCS, the prepare method
+ * should be called for the correct coordinate systems to make sure
+ * the state is correct.
*/
public interface BuoyGeometer {
@@ -13,20 +19,36 @@
* This method **may** set state inside the BuoyGeometer.
* @param into The matching parent and parent, giving the rectangle in
* which the whole buoyview and mainview are placed.
+ * @param key The key to use for the *FIRST* coordsys if a hierarchy
+ * is
+ * placed. This is so that several BuoyGeometers may
+ * be used in one coordinate system.
* @param create Whether to create the coordinate systems or just set
parameters
* in existing ones.
*/
- void prepare(int into, boolean create);
+ void prepare(VobScene vs, int into, Object key, boolean create);
/** Create or set the main coordinate system size.
* @param into The matching parent and parent, giving the rectangle in
* which the whole buoyview and mainview are placed.
* @param anchor The coordinate system of the anchor, or -1 if not
applicable.
+ * @param direction 1 for right, -1 for left.
* @param key The key to use for the returned coordinate system
* in into. There may be others in between.
- * @param w,h The size requested for the buoy.
+ * @param index The index of the buoy (counted from the anchor)
+ * @param total The total number of buoys from the anchor
+ * (might be inaccurate)
+ * @param w,h The size the buoy should be closest
+ * to the focus.
+ * @param scale The scale that should be applied to the w, h at
+ * focus
*/
- int buoyCS(int into, int anchor, Object key, float w, float h);
+ int buoyCS(VobScene vs, int into, int anchor,
+ int direction,
+ Object key,
+ int index, int total,
+ float w, float h, float scale);
+
}
Index: libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java
diff -u libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java:1.1
libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java:1.2
--- libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java:1.1 Fri Aug
8 12:30:08 2003
+++ libvob/org/nongnu/libvob/buoy/impl/RatioMainGeometer.java Sat Aug 9
07:15:50 2003
@@ -7,7 +7,7 @@
/** A BuoyMainViewGeometer that maintains a constant ratio
* of the box given to it.
*/
-public class RatioMainGeometer {
+public class RatioMainGeometer implements BuoyMainViewGeometer {
static float[] tmp = new float[2];
/** The coordinates of the rectangle in (0,1)x(0,1).
Index: libvob/vob/buoy/buoymanager.py
diff -u libvob/vob/buoy/buoymanager.py:1.37 libvob/vob/buoy/buoymanager.py:1.38
--- libvob/vob/buoy/buoymanager.py:1.37 Wed Aug 6 12:05:32 2003
+++ libvob/vob/buoy/buoymanager.py Sat Aug 9 07:15:50 2003
@@ -69,6 +69,7 @@
"""
self.mainNode = mainNode
self.connectors = connectors
+
def getMainNode(self):
return self.mainNode
def _nadir(self, cs):