123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- /*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ====================================================================
- */
-
- package org.apache.poi.xslf.usermodel;
-
- import java.awt.*;
- import java.awt.geom.*;
-
- /**
- * TODO: re-write and initialize from presetShapeDefinitions.xml
- *
- * @author Yegor Kozlov
- */
- public class XSLFPresetGeometry {
- public static final int LINE = 1;
- public static final int LINE_INV = 2;
- public static final int TRIANGLE = 3;
- public static final int RT_TRIANGLE = 4;
- public static final int RECT = 5;
- public static final int DIAMOND = 6;
- public static final int PARALLELOGRAM = 7;
- public static final int TRAPEZOID = 8;
- public static final int NON_ISOSCELES_TRAPEZOID = 9;
- public static final int PENTAGON = 10;
- public static final int HEXAGON = 11;
- public static final int HEPTAGON = 12;
- public static final int OCTAGON = 13;
- public static final int DECAGON = 14;
- public static final int DODECAGON = 15;
- public static final int STAR_4 = 16;
- public static final int STAR_5 = 17;
- public static final int STAR_6 = 18;
- public static final int STAR_7 = 19;
- public static final int STAR_8 = 20;
- public static final int STAR_10 = 21;
- public static final int STAR_12 = 22;
- public static final int STAR_16 = 23;
- public static final int STAR_24 = 24;
- public static final int STAR_32 = 25;
- public static final int ROUND_RECT = 26;
- public static final int ROUND_1_RECT = 27;
- public static final int ROUND_2_SAME_RECT = 28;
- public static final int ROUND_2_DIAG_RECT = 29;
- public static final int SNIP_ROUND_RECT = 30;
- public static final int SNIP_1_RECT = 31;
- public static final int SNIP_2_SAME_RECT = 32;
- public static final int SNIP_2_DIAG_RECT = 33;
- public static final int PLAQUE = 34;
- public static final int ELLIPSE = 35;
- public static final int TEARDROP = 36;
- public static final int HOME_PLATE = 37;
- public static final int CHEVRON = 38;
- public static final int PIE_WEDGE = 39;
- public static final int PIE = 40;
- public static final int BLOCK_ARC = 41;
- public static final int DONUT = 42;
- public static final int NO_SMOKING = 43;
- public static final int RIGHT_ARROW = 44;
- public static final int LEFT_ARROW = 45;
- public static final int UP_ARROW = 46;
- public static final int DOWN_ARROW = 47;
- public static final int STRIPED_RIGHT_ARROW = 48;
- public static final int NOTCHED_RIGHT_ARROW = 49;
- public static final int BENT_UP_ARROW = 50;
- public static final int LEFT_RIGHT_ARROW = 51;
- public static final int UP_DOWN_ARROW = 52;
- public static final int LEFT_UP_ARROW = 53;
- public static final int LEFT_RIGHT_UP_ARROW = 54;
- public static final int QUAD_ARROW = 55;
- public static final int LEFT_ARROW_CALLOUT = 56;
- public static final int RIGHT_ARROW_CALLOUT = 57;
- public static final int UP_ARROW_CALLOUT = 58;
- public static final int DOWN_ARROW_CALLOUT = 59;
- public static final int LEFT_RIGHT_ARROW_CALLOUT = 60;
- public static final int UP_DOWN_ARROW_CALLOUT = 61;
- public static final int QUAD_ARROW_CALLOUT = 62;
- public static final int BENT_ARROW = 63;
- public static final int UTURN_ARROW = 64;
- public static final int CIRCULAR_ARROW = 65;
- public static final int LEFT_CIRCULAR_ARROW = 66;
- public static final int LEFT_RIGHT_CIRCULAR_ARROW = 67;
- public static final int CURVED_RIGHT_ARROW = 68;
- public static final int CURVED_LEFT_ARROW = 69;
- public static final int CURVED_UP_ARROW = 70;
- public static final int CURVED_DOWN_ARROW = 71;
- public static final int SWOOSH_ARROW = 72;
- public static final int CUBE = 73;
- public static final int CAN = 74;
- public static final int LIGHTNING_BOLT = 75;
- public static final int HEART = 76;
- public static final int SUN = 77;
- public static final int MOON = 78;
- public static final int SMILEY_FACE = 79;
- public static final int IRREGULAR_SEAL_1 = 80;
- public static final int IRREGULAR_SEAL_2 = 81;
- public static final int FOLDED_CORNER = 82;
- public static final int BEVEL = 83;
- public static final int FRAME = 84;
- public static final int HALF_FRAME = 85;
- public static final int CORNER = 86;
- public static final int DIAG_STRIPE = 87;
- public static final int CHORD = 88;
- public static final int ARC = 89;
- public static final int LEFT_BRACKET = 90;
- public static final int RIGHT_BRACKET = 91;
- public static final int LEFT_BRACE = 92;
- public static final int RIGHT_BRACE = 93;
- public static final int BRACKET_PAIR = 94;
- public static final int BRACE_PAIR = 95;
- public static final int STRAIGHT_CONNECTOR_1 = 96;
- public static final int BENT_CONNECTOR_2 = 97;
- public static final int BENT_CONNECTOR_3 = 98;
- public static final int BENT_CONNECTOR_4 = 99;
- public static final int BENT_CONNECTOR_5 = 100;
- public static final int CURVED_CONNECTOR_2 = 101;
- public static final int CURVED_CONNECTOR_3 = 102;
- public static final int CURVED_CONNECTOR_4 = 103;
- public static final int CURVED_CONNECTOR_5 = 104;
- public static final int CALLOUT_1 = 105;
- public static final int CALLOUT_2 = 106;
- public static final int CALLOUT_3 = 107;
- public static final int ACCENT_CALLOUT_1 = 108;
- public static final int ACCENT_CALLOUT_2 = 109;
- public static final int ACCENT_CALLOUT_3 = 110;
- public static final int BORDER_CALLOUT_1 = 111;
- public static final int BORDER_CALLOUT_2 = 112;
- public static final int BORDER_CALLOUT_3 = 113;
- public static final int ACCENT_BORDER_CALLOUT_1 = 114;
- public static final int ACCENT_BORDER_CALLOUT_2 = 115;
- public static final int ACCENT_BORDER_CALLOUT_3 = 116;
- public static final int WEDGE_RECT_CALLOUT = 117;
- public static final int WEDGE_ROUND_RECT_CALLOUT = 118;
- public static final int WEDGE_ELLIPSE_CALLOUT = 119;
- public static final int CLOUD_CALLOUT = 120;
- public static final int CLOUD = 121;
- public static final int RIBBON = 122;
- public static final int RIBBON_2 = 123;
- public static final int ELLIPSE_RIBBON = 124;
- public static final int ELLIPSE_RIBBON_2 = 125;
- public static final int LEFT_RIGHT_RIBBON = 126;
- public static final int VERTICAL_SCROLL = 127;
- public static final int HORIZONTAL_SCROLL = 128;
- public static final int WAVE = 129;
- public static final int DOUBLE_WAVE = 130;
- public static final int PLUS = 131;
- public static final int FLOW_CHART_PROCESS = 132;
- public static final int FLOW_CHART_DECISION = 133;
- public static final int FLOW_CHART_INPUT_OUTPUT = 134;
- public static final int FLOW_CHART_PREDEFINED_PROCESS = 135;
- public static final int FLOW_CHART_INTERNAL_STORAGE = 136;
- public static final int FLOW_CHART_DOCUMENT = 137;
- public static final int FLOW_CHART_MULTIDOCUMENT = 138;
- public static final int FLOW_CHART_TERMINATOR = 139;
- public static final int FLOW_CHART_PREPARATION = 140;
- public static final int FLOW_CHART_MANUAL_INPUT = 141;
- public static final int FLOW_CHART_MANUAL_OPERATION = 142;
- public static final int FLOW_CHART_CONNECTOR = 143;
- public static final int FLOW_CHART_PUNCHED_CARD = 144;
- public static final int FLOW_CHART_PUNCHED_TAPE = 145;
- public static final int FLOW_CHART_SUMMING_JUNCTION = 146;
- public static final int FLOW_CHART_OR = 147;
- public static final int FLOW_CHART_COLLATE = 148;
- public static final int FLOW_CHART_SORT = 149;
- public static final int FLOW_CHART_EXTRACT = 150;
- public static final int FLOW_CHART_MERGE = 151;
- public static final int FLOW_CHART_OFFLINE_STORAGE = 152;
- public static final int FLOW_CHART_ONLINE_STORAGE = 153;
- public static final int FLOW_CHART_MAGNETIC_TAPE = 154;
- public static final int FLOW_CHART_MAGNETIC_DISK = 155;
- public static final int FLOW_CHART_MAGNETIC_DRUM = 156;
- public static final int FLOW_CHART_DISPLAY = 157;
- public static final int FLOW_CHART_DELAY = 158;
- public static final int FLOW_CHART_ALTERNATE_PROCESS = 159;
- public static final int FLOW_CHART_OFFPAGE_CONNECTOR = 160;
- public static final int ACTION_BUTTON_BLANK = 161;
- public static final int ACTION_BUTTON_HOME = 162;
- public static final int ACTION_BUTTON_HELP = 163;
- public static final int ACTION_BUTTON_INFORMATION = 164;
- public static final int ACTION_BUTTON_FORWARD_NEXT = 165;
- public static final int ACTION_BUTTON_BACK_PREVIOUS = 166;
- public static final int ACTION_BUTTON_END = 167;
- public static final int ACTION_BUTTON_BEGINNING = 168;
- public static final int ACTION_BUTTON_RETURN = 169;
- public static final int ACTION_BUTTON_DOCUMENT = 170;
- public static final int ACTION_BUTTON_SOUND = 171;
- public static final int ACTION_BUTTON_MOVIE = 172;
- public static final int GEAR_6 = 173;
- public static final int GEAR_9 = 174;
- public static final int FUNNEL = 175;
- public static final int MATH_PLUS = 176;
- public static final int MATH_MINUS = 177;
- public static final int MATH_MULTIPLY = 178;
- public static final int MATH_DIVIDE = 179;
- public static final int MATH_EQUAL = 180;
- public static final int MATH_NOT_EQUAL = 181;
- public static final int CORNER_TABS = 182;
- public static final int SQUARE_TABS = 183;
- public static final int PLAQUE_TABS = 184;
- public static final int CHART_X = 185;
- public static final int CHART_STAR = 186;
- public static final int CHART_PLUS = 187;
-
- private static interface ShapeOutline {
- java.awt.Shape getOutline(XSLFAutoShape shape);
- }
-
-
- static ShapeOutline[] shapes;
- static {
- shapes = new ShapeOutline[255];
-
- shapes[RECT] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- Rectangle2D path = new Rectangle2D.Float(0, 0, 21600, 21600);
- return path;
- }
- };
-
- shapes[ROUND_RECT] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
- RoundRectangle2D path = new RoundRectangle2D.Float(0, 0, 21600, 21600, adjval, adjval);
- return path;
- }
- };
-
- shapes[ELLIPSE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- Ellipse2D path = new Ellipse2D.Float(0, 0, 21600, 21600);
- return path;
- }
- };
-
- shapes[DIAMOND] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- GeneralPath path = new GeneralPath();
- path.moveTo(10800, 0);
- path.lineTo(21600, 10800);
- path.lineTo(10800, 21600);
- path.lineTo(0, 10800);
- path.closePath();
- return path;
- }
- };
-
- //m@0,l,21600r21600
- shapes[TRIANGLE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(0, 21600);
- path.lineTo(21600, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[RT_TRIANGLE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(21600, 21600);
- path.lineTo(0, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[PARALLELOGRAM] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(21600, 0);
- path.lineTo(21600 - adjval, 21600);
- path.lineTo(0, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[TRAPEZOID] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(adjval, 21600);
- path.lineTo(21600 - adjval, 21600);
- path.lineTo(21600, 0);
- path.closePath();
- return path;
- }
- };
-
- shapes[HEXAGON] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(21600 - adjval, 0);
- path.lineTo(21600, 10800);
- path.lineTo(21600 - adjval, 21600);
- path.lineTo(adjval, 21600);
- path.lineTo(0, 10800);
- path.closePath();
- return path;
- }
- };
-
- shapes[OCTAGON] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 6324);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(21600 - adjval, 0);
- path.lineTo(21600, adjval);
- path.lineTo(21600, 21600-adjval);
- path.lineTo(21600-adjval, 21600);
- path.lineTo(adjval, 21600);
- path.lineTo(0, 21600-adjval);
- path.lineTo(0, adjval);
- path.closePath();
- return path;
- }
- };
-
- shapes[PLUS] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(21600 - adjval, 0);
- path.lineTo(21600 - adjval, adjval);
- path.lineTo(21600, adjval);
- path.lineTo(21600, 21600-adjval);
- path.lineTo(21600-adjval, 21600-adjval);
- path.lineTo(21600-adjval, 21600);
- path.lineTo(adjval, 21600);
- path.lineTo(adjval, 21600-adjval);
- path.lineTo(0, 21600-adjval);
- path.lineTo(0, adjval);
- path.lineTo(adjval, adjval);
- path.closePath();
- return path;
- }
- };
-
- shapes[PENTAGON] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
-
- GeneralPath path = new GeneralPath();
- path.moveTo(10800, 0);
- path.lineTo(21600, 8259);
- path.lineTo(21600 - 4200, 21600);
- path.lineTo(4200, 21600);
- path.lineTo(0, 8259);
- path.closePath();
- return path;
- }
- };
-
- shapes[HOME_PLATE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
-
- GeneralPath path = new GeneralPath();
- int adjval = shape.getAdjustValue("adj1", 16200);
- path.moveTo(0, 0);
- path.lineTo(adjval, 0 );
- path.lineTo(21600, 10800);
- path.lineTo(adjval, 21600);
- path.lineTo(0, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[CHEVRON] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- GeneralPath path = new GeneralPath();
- int adjval = shape.getAdjustValue("adj1", 16200);
- path.moveTo(0, 0);
- path.lineTo(adjval, 0 );
- path.lineTo(21600, 10800);
- path.lineTo(adjval, 21600);
- path.lineTo(0, 21600);
- path.lineTo(21600 - adjval, 10800);
- path.closePath();
- return path;
- }
- };
-
- shapes[CAN] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- int adjval = shape.getAdjustValue("adj1", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(21600, 0);
- path.lineTo(21600, 21600);
- path.lineTo(0, 21600);
-
- //path.lineTo(21600, adjval);
-
- path.closePath();
- path.moveTo(10800, 0);
- //path.append(new Arc2D.Float(10800, 0, 10800, adjval, 0, 90, Arc2D.OPEN), true);
- path.moveTo(10800, adjval/2);
- path.append(new Arc2D.Float(10800, adjval/2, 10800, adjval, 90, 180, Arc2D.OPEN), true);
- //path.append(new Arc2D.Float(0, adjval/2, 10800, adjval, 180, 270, Arc2D.OPEN), true);
- //path.append(new Arc2D.Float(0, 0, 10800, adjval, 270, 360, Arc2D.OPEN), true);
- return path;
- }
- };
-
- shapes[DOWN_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m0@0 l@1@0 @1,0 @2,0 @2@0,21600@0,10800,21600xe
- int adjval = shape.getAdjustValue("adj1", 16200);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(0, adjval);
- path.lineTo(adjval2, adjval);
- path.lineTo(adjval2, 0);
- path.lineTo(21600-adjval2, 0);
- path.lineTo(21600-adjval2, adjval);
- path.lineTo(21600, adjval);
- path.lineTo(10800, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[UP_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m0@0 l@1@0 @1,21600@2,21600@2@0,21600@0,10800,xe
- int adjval = shape.getAdjustValue("adj1", 5400);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(0, adjval);
- path.lineTo(adjval2, adjval);
- path.lineTo(adjval2, 21600);
- path.lineTo(21600-adjval2, 21600);
- path.lineTo(21600-adjval2, adjval);
- path.lineTo(21600, adjval);
- path.lineTo(10800, 0);
- path.closePath();
- return path;
- }
- };
-
- shapes[RIGHT_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m@0, l@0@1 ,0@1,0@2@0@2@0,21600,21600,10800xe
- int adjval = shape.getAdjustValue("adj1", 16200);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(adjval, adjval2);
- path.lineTo(0, adjval2);
- path.lineTo(0, 21600-adjval2);
- path.lineTo(adjval, 21600-adjval2);
- path.lineTo(adjval, 21600);
- path.lineTo(21600, 10800);
- path.closePath();
- return path;
- }
- };
-
- shapes[LEFT_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m@0, l@0@1,21600@1,21600@2@0@2@0,21600,,10800xe
- int adjval = shape.getAdjustValue("adj1", 5400);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval, 0);
- path.lineTo(adjval, adjval2);
- path.lineTo(21600, adjval2);
- path.lineTo(21600, 21600-adjval2);
- path.lineTo(adjval, 21600-adjval2);
- path.lineTo(adjval, 21600);
- path.lineTo(0, 10800);
- path.closePath();
- return path;
- }
- };
- shapes[LEFT_BRACE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m21600,qx10800@0l10800@2qy0@11,10800@3l10800@1qy21600,21600e
- int adjval = shape.getAdjustValue("adj1", 1800);
- int adjval2 = shape.getAdjustValue("adj2", 10800);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(21600, 0);
-
- path.append(new Arc2D.Float(10800, 0, 21600, adjval*2, 90, 90, Arc2D.OPEN), false);
- path.moveTo(10800, adjval);
-
- path.lineTo(10800, adjval2 - adjval);
-
- path.append(new Arc2D.Float(-10800, adjval2 - 2*adjval, 21600, adjval*2, 270, 90, Arc2D.OPEN), false);
- path.moveTo(0, adjval2);
-
- path.append(new Arc2D.Float(-10800, adjval2, 21600, adjval*2, 0, 90, Arc2D.OPEN), false);
- path.moveTo(10800, adjval2 + adjval);
-
- path.lineTo(10800, 21600 - adjval);
-
- path.append(new Arc2D.Float(10800, 21600 - 2*adjval, 21600, adjval*2, 180, 90, Arc2D.OPEN), false);
-
- return path;
- }
- };
-
- shapes[RIGHT_BRACE] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m,qx10800@0 l10800@2qy21600@11,10800@3l10800@1qy,21600e
- int adjval = shape.getAdjustValue("adj1", 1800);
- int adjval2 = shape.getAdjustValue("adj2", 10800);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
-
- path.append(new Arc2D.Float(-10800, 0, 21600, adjval*2, 0, 90, Arc2D.OPEN), false);
- path.moveTo(10800, adjval);
-
- path.lineTo(10800, adjval2 - adjval);
-
- path.append(new Arc2D.Float(10800, adjval2 - 2*adjval, 21600, adjval*2, 180, 90, Arc2D.OPEN), false);
- path.moveTo(21600, adjval2);
-
- path.append(new Arc2D.Float(10800, adjval2, 21600, adjval*2, 90, 90, Arc2D.OPEN), false);
- path.moveTo(10800, adjval2 + adjval);
-
- path.lineTo(10800, 21600 - adjval);
-
- path.append(new Arc2D.Float(-10800, 21600 - 2*adjval, 21600, adjval*2, 270, 90, Arc2D.OPEN), false);
-
- return path;
- }
- };
-
-
- shapes[LEFT_RIGHT_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m,10800l@0,21600@0@3@2@3@2,21600,21600,10800@2,0@2@1@0@1@0,xe
- int adjval = shape.getAdjustValue("adj1", 4320);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 10800);
- path.lineTo(adjval, 0);
- path.lineTo(adjval, adjval2);
- path.lineTo(21600 - adjval, adjval2);
- path.lineTo(21600 - adjval, 0);
- path.lineTo(21600, 10800);
- path.lineTo(21600 - adjval, 21600);
- path.lineTo(21600 - adjval, 21600 - adjval2);
- path.lineTo(adjval, 21600 - adjval2);
- path.lineTo(adjval, 21600);
- path.closePath();
- return path;
- }
- };
-
- shapes[UP_DOWN_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m10800,l21600@0@3@0@3@2,21600@2,10800,21600,0@2@1@2@1@0,0@0xe
- int adjval1 = shape.getAdjustValue("adj1", 5400);
- int adjval2 = shape.getAdjustValue("adj2", 4320);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(10800, 0);
- path.lineTo(21600, adjval2);
- path.lineTo(21600 - adjval1, adjval2);
- path.lineTo(21600 - adjval1, 21600 - adjval2);
- path.lineTo(21600, 21600 - adjval2);
-
- path.lineTo(10800, 21600);
- path.lineTo(0, 21600 - adjval2);
- path.lineTo(adjval1, 21600 - adjval2);
- path.lineTo(adjval1, adjval2);
- path.lineTo(0, adjval2);
-
- path.closePath();
- return path;
- }
- };
-
- shapes[NOTCHED_RIGHT_ARROW] = new ShapeOutline(){
- public java.awt.Shape getOutline(XSLFAutoShape shape){
- //m@0,l@0@1,0@1@5,10800,0@2@0@2@0,21600,21600,10800xe
- int adjval1 = shape.getAdjustValue("adj1", 16200);
- int adjval2 = shape.getAdjustValue("adj2", 5400);
-
- GeneralPath path = new GeneralPath();
- path.moveTo(adjval1, 0);
- path.lineTo(adjval1, adjval2);
- path.lineTo(0, adjval2);
- //The notch at the end stays adjusted so that it matches the shape of the arrowhead.
- int notch = (21600-2*adjval2)*(21600-adjval1)/21600;
- path.lineTo(notch, 10800);
- path.lineTo(0, 21600 - adjval2);
- path.lineTo(adjval1, 21600 - adjval2);
- path.lineTo(adjval1, 21600);
- path.lineTo(21600, 10800);
- path.closePath();
- return path;
- }
- };
- }
-
- static Shape getOutline(XSLFAutoShape shape){
- ShapeOutline outline = shapes[shape.getShapeType()];
- return outline == null ? null : outline.getOutline(shape);
- }
- }
|