name.dhiller.jBorderLiner
Class Borders

java.lang.Object
  extended by name.dhiller.jBorderLiner.Borders

public class Borders
extends Object

Borders handling

Version:
120204
Author:
Dietmar Hiller (Dhiller)

Field Summary
private static short APPLYTO_CELL
           
private static short APPLYTO_TABLE
           
 
Constructor Summary
Borders()
          Creates a new instance of Borders
 
Method Summary
private static com.sun.star.table.BorderLine convert2toBorderLine(com.sun.star.table.BorderLine2 inBL2)
          Convert BorderLine2 to BorderLine
static void DoBorders(com.sun.star.frame.XFrame xFrame, short Modifiers, short KeyCode)
          DoBorders - get or set Borders
static com.sun.star.table.BorderLine2 GetBorderLine2(short Modifiers)
          Get borders defined in the toolbar or zero if deleting desired (BorderLine2)
static void GetBordersCell(Object oRange, short Modifiers, short KeyCode)
          Get Borders from Cells
static void GetBordersTable(Object oRange, short Modifiers, short KeyCode)
          Get Borders from Table DEACTIVATED - requires manual conversion from Borderline2 to Borderline - not possible
private static Object GetTheCell(com.sun.star.frame.XFrame xFrame, short sApplyTo)
          Cells the border shall be applied to
static void SetBordersCell(Object oRange, short Modifiers, short KeyCode)
          Set borders of cell or range(s) of cells
static void SetBordersCellRange(Object oRange, short Modifiers, short KeyCode)
          Set borders of cell or range of cells with 1 or more formats
static void SetBordersSingleCell(Object oRange, short Modifiers, short KeyCode)
          Set borders of cell or range(s) of cells
static void SetBordersTable(Object oRange, short Modifiers, short KeyCode)
          Set borders of table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLYTO_CELL

private static final short APPLYTO_CELL
See Also:
Constant Field Values

APPLYTO_TABLE

private static final short APPLYTO_TABLE
See Also:
Constant Field Values
Constructor Detail

Borders

public Borders()
Creates a new instance of Borders

Method Detail

DoBorders

public static void DoBorders(com.sun.star.frame.XFrame xFrame,
                             short Modifiers,
                             short KeyCode)
DoBorders - get or set Borders

Parameters:
xFrame -
Modifiers - com.sun.star.awt.KeyModifier.SHIFT, .MOD1 (Ctrl), .MOD2 (Alt)
KeyCode - com.sun.star.awt.Key.NUM1 ... .NUM9

GetTheCell

private static Object GetTheCell(com.sun.star.frame.XFrame xFrame,
                                 short sApplyTo)
Cells the border shall be applied to

Throws:
ex.printStackTrace() - IllegalArgumentException, UnknownPropertyException, WrappedTargetException

GetBordersCell

public static void GetBordersCell(Object oRange,
                                  short Modifiers,
                                  short KeyCode)
Get Borders from Cells

Parameters:
oRange - - where to get the borders from
Modifiers - - always .MOD1 (ctrl)
KeyCode - - NUM1 .. NUM9
Throws:
com.sun.star.lang.WrappedTargetException - ex.printStackTrace()
com.sun.star.beans.UnknownPropertyException - ex.printStackTrace()

GetBordersTable

public static void GetBordersTable(Object oRange,
                                   short Modifiers,
                                   short KeyCode)
Get Borders from Table DEACTIVATED - requires manual conversion from Borderline2 to Borderline - not possible

Parameters:
oRange - to get borders from
Modifiers - always .MOD1 (CTRL)
KeyCode - NUM1 ... NUM9

SetBordersCell

public static void SetBordersCell(Object oRange,
                                  short Modifiers,
                                  short KeyCode)
Set borders of cell or range(s) of cells

Parameters:
oRange -
Modifiers - - .SHIFT, .ALT
KeyCode - - NUM1 .. NUM8
Throws:
ex.printStackTrace - - NoSuchElementException, WrappedTargetException

SetBordersCellRange

public static void SetBordersCellRange(Object oRange,
                                       short Modifiers,
                                       short KeyCode)
Set borders of cell or range of cells with 1 or more formats

Parameters:
oRange -
Modifiers - - .SHIFT, .ALT
KeyCode - - NUM1 .. NUM8
Throws:
ex.printStackTrace - - HeadlessException, WrappedTargetException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException

SetBordersSingleCell

public static void SetBordersSingleCell(Object oRange,
                                        short Modifiers,
                                        short KeyCode)
Set borders of cell or range(s) of cells

Parameters:
oRange -
Modifiers - - .SHIFT, .ALT
KeyCode - - NUM1 .. NUM8
Throws:
ex.printStackTrace - - HeadlessException, WrappedTargetException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException

SetBordersTable

public static void SetBordersTable(Object oRange,
                                   short Modifiers,
                                   short KeyCode)
Set borders of table

Parameters:
oRange -
Modifiers - - .SHIFT, .ALT
KeyCode - - NUM2 .. NUM9
Throws:
ex.printStackTrace - - HeadlessException, WrappedTargetException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException

GetBorderLine2

public static com.sun.star.table.BorderLine2 GetBorderLine2(short Modifiers)
Get borders defined in the toolbar or zero if deleting desired (BorderLine2)

Parameters:
Modifiers - - .SHIFT, .ALT

convert2toBorderLine

private static com.sun.star.table.BorderLine convert2toBorderLine(com.sun.star.table.BorderLine2 inBL2)
Convert BorderLine2 to BorderLine

Parameters:
inBL2 -
Returns: