diff --git a/src/org/zlibrary/text/view/impl/ZLTextViewImpl.java b/src/org/zlibrary/text/view/impl/ZLTextViewImpl.java index 8ec5f9961..24fa5958a 100644 --- a/src/org/zlibrary/text/view/impl/ZLTextViewImpl.java +++ b/src/org/zlibrary/text/view/impl/ZLTextViewImpl.java @@ -36,10 +36,18 @@ public class ZLTextViewImpl extends ZLTextView { myContext.setFont(myStyle.fontFamily(), myStyle.fontSize(), myStyle.bold(), myStyle.italic()); } -/* public void applyControl(ZLTextControlElement control) { - } + public void applyControl(ZLTextControlElement control) { +/* if (control.isStart()) { + ZLTextStyleDecoration decoration = new ZLTextStyleDecoration(control.getEntry()); + setStyle(decoration.createDecoratedStyle(myStyle)); + } else { + if (myStyle.isDecorated()) { + setStyle(((ZLTextDecoratedStyle) myStyle).base()); + } + } +*/ } + -*/ public ZLPaintContext getPaintContext() { return myContext; } @@ -146,7 +154,7 @@ public class ZLTextViewImpl extends ZLTextView { w += dw; } } - h += info.Height; + h += info.Height + info.Descent; } } diff --git a/src/org/zlibrary/text/view/style/ZLTextBaseStyle.class b/src/org/zlibrary/text/view/style/ZLTextBaseStyle.class new file mode 100644 index 000000000..9efbeec00 Binary files /dev/null and b/src/org/zlibrary/text/view/style/ZLTextBaseStyle.class differ diff --git a/src/org/zlibrary/text/view/style/ZLTextDecoratedStyle.java b/src/org/zlibrary/text/view/style/ZLTextDecoratedStyle.java new file mode 100644 index 000000000..a6c160533 --- /dev/null +++ b/src/org/zlibrary/text/view/style/ZLTextDecoratedStyle.java @@ -0,0 +1,4 @@ +package org.zlibrary.text.view.style; + +public class ZLTextDecoratedStyle { +} diff --git a/src/org/zlibrary/text/view/style/ZLTextFullDecoratedStyle.java b/src/org/zlibrary/text/view/style/ZLTextFullDecoratedStyle.java new file mode 100644 index 000000000..d3c1c3f70 --- /dev/null +++ b/src/org/zlibrary/text/view/style/ZLTextFullDecoratedStyle.java @@ -0,0 +1,5 @@ +package org.zlibrary.text.view.style; + +public class ZLTextFullDecoratedStyle { + +} diff --git a/src/org/zlibrary/text/view/style/ZLTextFullStyleDecoration.java b/src/org/zlibrary/text/view/style/ZLTextFullStyleDecoration.java new file mode 100644 index 000000000..845d06f8a --- /dev/null +++ b/src/org/zlibrary/text/view/style/ZLTextFullStyleDecoration.java @@ -0,0 +1,32 @@ +package org.zlibrary.text.view.style; + +import org.zlibrary.options.*; +import org.zlibrary.options.util.*; + +import org.zlibrary.text.view.ZLTextStyle; + +import org.zlibrary.text.model.ZLTextAlignmentType; + +public class ZLTextFullStyleDecoration extends ZLTextStyleDecoration { + public ZLIntegerRangeOption SpaceBeforeOption; + public ZLIntegerRangeOption SpaceAfterOption; + public ZLIntegerRangeOption LeftIndentOption; + public ZLIntegerRangeOption RightIndentOption; + public ZLIntegerRangeOption FirstLineIndentDeltaOption; + + public ZLIntegerOption AlignmentOption; + + public ZLDoubleOption LineSpaceOption; + + public ZLTextFullStyleDecoration(String name, int fontSizeDelta, ZLBoolean3 bold, ZLBoolean3 italic, int spaceBefore, int spaceAfter, int leftIndent,int rightIndent, int firstLineDelta, int verticalShift, ZLTextAlignmentType alignment, double lineSpace, ZLBoolean3 allowHyphenations) { + super(name, fontSizeDelta, bold, italic, verticalShift, allowHyphenations); + } + + public boolean isFullDecoration() { + return true; + } + +// public ZLTextStyle createDecoratedStyle(ZLTextStyle base) { +// +// } +} diff --git a/src/org/zlibrary/text/view/style/ZLTextStyleDecoration.java b/src/org/zlibrary/text/view/style/ZLTextStyleDecoration.java new file mode 100644 index 000000000..f140bde92 --- /dev/null +++ b/src/org/zlibrary/text/view/style/ZLTextStyleDecoration.java @@ -0,0 +1,39 @@ +package org.zlibrary.text.view.style; + +import org.zlibrary.options.util.*; +import org.zlibrary.options.*; + +import org.zlibrary.text.view.ZLTextStyle; + + +public class ZLTextStyleDecoration { + public static final String STYLE = "Style"; + + public ZLStringOption FontFamilyOption; + public ZLIntegerRangeOption FontSizeDeltaOption; + public ZLBoolean3Option BoldOption; + public ZLBoolean3Option ItalicOption; + + private String myName; + + public ZLIntegerOption VerticalShiftOption; + + public ZLBoolean3Option AllowHyphenationsOption; + + public ZLTextStyleDecoration(String name, int fontSizeDelta, ZLBoolean3 bold, ZLBoolean3 italic, int verticalShift, ZLBoolean3 allowHyphenations) { + FontFamilyOption = null; + FontSizeDeltaOption = null; + BoldOption = new ZLBoolean3Option(ZLOption.LOOK_AND_FEEL_CATEGORY, STYLE, name + ":bold", bold); + ItalicOption = null; + VerticalShiftOption = null; + AllowHyphenationsOption = null; + } + + public boolean isFullDecoration() { + return false; + } + + public String getName() { + return myName; + } +}