Search in sources :

Example 11 with Stroke

use of com.codename1.ui.Stroke in project CodenameOne by codenameone.

the class RoundBorder method stroke.

/**
 * Sets the stroke of the circle/rectangle
 * @param stroke the thickness of the stroke object
 * @param mm set to true to indicate the value is in millimeters, false indicates pixels
 * @return border instance so these calls can be chained
 */
public RoundBorder stroke(float stroke, boolean mm) {
    strokeThickness = stroke;
    if (strokeThickness == 0) {
        this.stroke = null;
        return this;
    }
    strokeMM = mm;
    if (mm) {
        stroke = Display.getInstance().convertToPixels(stroke);
    }
    return stroke(new Stroke(stroke, Stroke.CAP_SQUARE, Stroke.JOIN_MITER, 1));
}
Also used : Stroke(com.codename1.ui.Stroke)

Example 12 with Stroke

use of com.codename1.ui.Stroke in project CodenameOne by codenameone.

the class IOSImplementation method createImage.

@Override
public Image createImage(Shape shape, Stroke stroke, int color) {
    NativePathRenderer renderer = renderShape(shape, stroke);
    int[] argb = renderer.toARGB(color);
    int[] bounds = new int[4];
    renderer.getOutputBounds(bounds);
    Image out = Image.createImage(argb, bounds[2] - bounds[0], bounds[3] - bounds[1]);
    renderer.destroy();
    return out;
}
Also used : Image(com.codename1.ui.Image)

Example 13 with Stroke

use of com.codename1.ui.Stroke in project CodenameOne by codenameone.

the class Graphics method drawShape.

// --------------------------------------------------------------------------
// START SHAPE DRAWING STUFF
// --------------------------------------------------------------------------
/**
 * Draws a outline shape inside the specified bounding box.  The bounding box will resize the shape to fit in its dimensions.
 * <p>This is not supported on
 * all platforms and contexts currently.  Use {@link #isShapeSupported} to check if the current
 * context supports drawing shapes.</p>
 *
 * <script src="https://gist.github.com/codenameone/3f2f8cdaabb7780eae6f.js"></script>
 * <img src="https://www.codenameone.com/img/developer-guide/graphics-shape-fill.png" alt="Fill a shape general path" />
 *
 * @param shape The shape to be drawn.
 * @param stroke the stroke to use
 *
 * @see #setStroke
 * @see #isShapeSupported
 */
public void drawShape(Shape shape, Stroke stroke) {
    if (isShapeSupported()) {
        if (xTranslate != 0 || yTranslate != 0) {
            GeneralPath p = tmpClipShape();
            p.setShape(shape, translation());
            shape = p;
        }
        impl.drawShape(nativeGraphics, shape, stroke);
    }
}
Also used : GeneralPath(com.codename1.ui.geom.GeneralPath)

Example 14 with Stroke

use of com.codename1.ui.Stroke in project CodenameOne by codenameone.

the class BorderEditor method initComponents.

/**
 * This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
void initComponents() {
    jPanel6 = new javax.swing.JPanel();
    borderType = new javax.swing.JComboBox();
    jLabel1 = new javax.swing.JLabel();
    jPanel5 = new javax.swing.JPanel();
    imageBorderPreview = new com.codename1.ui.resource.util.CodenameOneComponentWrapper();
    jPanel1 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    generalSettings = new javax.swing.JPanel();
    changeHighlightColor = new javax.swing.JButton();
    thickness = new javax.swing.JSpinner();
    jLabel2 = new javax.swing.JLabel();
    arcHeight = new javax.swing.JSpinner();
    changeSecondaryHighlightColor = new javax.swing.JButton();
    changeSecondaryShadowColor = new javax.swing.JButton();
    shadowColor = new javax.swing.JTextField();
    changeLineColor = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    secondaryShadowColor = new javax.swing.JTextField();
    jLabel6 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    highlightColor = new javax.swing.JTextField();
    jLabel12 = new javax.swing.JLabel();
    secondaryHighlightColor = new javax.swing.JTextField();
    arcWidth = new javax.swing.JSpinner();
    raisedBorder = new javax.swing.JCheckBox();
    changeShadowColor = new javax.swing.JButton();
    jLabel8 = new javax.swing.JLabel();
    lineColor = new javax.swing.JTextField();
    jLabel9 = new javax.swing.JLabel();
    themeColors = new javax.swing.JCheckBox();
    jLabel7 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    thicknessMillimeters = new javax.swing.JCheckBox();
    imageBorderSettings = new javax.swing.JPanel();
    imageMode = new javax.swing.JCheckBox();
    jPanel4 = new javax.swing.JPanel();
    topLeft = new javax.swing.JComboBox();
    top = new javax.swing.JComboBox();
    topRight = new javax.swing.JComboBox();
    left = new javax.swing.JComboBox();
    center = new javax.swing.JComboBox();
    right = new javax.swing.JComboBox();
    bottomLeft = new javax.swing.JComboBox();
    bottom = new javax.swing.JComboBox();
    bottomRight = new javax.swing.JComboBox();
    roundBorderSettings = new javax.swing.JPanel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    strokeMillimeter = new javax.swing.JCheckBox();
    jLabel16 = new javax.swing.JLabel();
    jLabel17 = new javax.swing.JLabel();
    jLabel18 = new javax.swing.JLabel();
    jLabel19 = new javax.swing.JLabel();
    jLabel20 = new javax.swing.JLabel();
    strokeThickness = new javax.swing.JSpinner();
    opacity = new javax.swing.JSpinner();
    strokeColor = new javax.swing.JTextField();
    strokeColorPicker = new javax.swing.JButton();
    strokeOpacity = new javax.swing.JSpinner();
    shadowOpacity = new javax.swing.JSpinner();
    shadowSpread = new javax.swing.JSpinner();
    shadowX = new javax.swing.JSpinner();
    shadowY = new javax.swing.JSpinner();
    shadowBlur = new javax.swing.JSpinner();
    isRectangle = new javax.swing.JCheckBox();
    jLabel21 = new javax.swing.JLabel();
    backgroundColor = new javax.swing.JTextField();
    backgroundColorPicker = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jLabel22 = new javax.swing.JLabel();
    rrStrokeColor = new javax.swing.JTextField();
    rrStrokeColorPicker = new javax.swing.JButton();
    jLabel23 = new javax.swing.JLabel();
    rrStrokeOpacity = new javax.swing.JSpinner();
    jLabel24 = new javax.swing.JLabel();
    rrStrokeThickness = new javax.swing.JSpinner();
    rrStrokeMillimeter = new javax.swing.JCheckBox();
    jLabel25 = new javax.swing.JLabel();
    rrShadowOpacity = new javax.swing.JSpinner();
    jLabel26 = new javax.swing.JLabel();
    rrShadowSpread = new javax.swing.JSpinner();
    jLabel27 = new javax.swing.JLabel();
    rrShadowX = new javax.swing.JSpinner();
    jLabel28 = new javax.swing.JLabel();
    rrShadowY = new javax.swing.JSpinner();
    jLabel29 = new javax.swing.JLabel();
    rrShadowBlur = new javax.swing.JSpinner();
    jLabel30 = new javax.swing.JLabel();
    rrRadius = new javax.swing.JSpinner();
    jLabel31 = new javax.swing.JLabel();
    rrBezier = new javax.swing.JCheckBox();
    jLabel32 = new javax.swing.JLabel();
    rrMode = new javax.swing.JComboBox();
    FormListener formListener = new FormListener();
    // NOI18N
    setName("Form");
    setLayout(new java.awt.BorderLayout());
    // NOI18N
    jPanel6.setName("jPanel6");
    jPanel6.setLayout(new java.awt.BorderLayout());
    borderType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "[Null]", "[Empty]", "Bevel", "Etched", "Line", "Underline", "Rounded (Deprecated)", "Image", "Horizontal Image", "Vertical Image", "Round (circle or square whose corners are completely round)", "Rounded Rectangle" }));
    // NOI18N
    borderType.setName("borderType");
    borderType.addActionListener(formListener);
    jPanel6.add(borderType, java.awt.BorderLayout.CENTER);
    jLabel1.setText("Type");
    // NOI18N
    jLabel1.setName("jLabel1");
    jPanel6.add(jLabel1, java.awt.BorderLayout.LINE_START);
    add(jPanel6, java.awt.BorderLayout.NORTH);
    // NOI18N
    jPanel5.setName("jPanel5");
    jPanel5.setLayout(new java.awt.BorderLayout());
    imageBorderPreview.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    // NOI18N
    imageBorderPreview.setName("imageBorderPreview");
    imageBorderPreview.setPreferredSize(new java.awt.Dimension(200, 80));
    jPanel5.add(imageBorderPreview, java.awt.BorderLayout.CENTER);
    // NOI18N
    jPanel1.setName("jPanel1");
    // NOI18N
    jPanel3.setName("jPanel3");
    jPanel3.setLayout(new java.awt.GridLayout(1, 2));
    okButton.setText("OK");
    // NOI18N
    okButton.setName("okButton");
    okButton.addActionListener(formListener);
    jPanel3.add(okButton);
    cancelButton.setText("Cancel");
    // NOI18N
    cancelButton.setName("cancelButton");
    cancelButton.addActionListener(formListener);
    jPanel3.add(cancelButton);
    jPanel1.add(jPanel3);
    jPanel5.add(jPanel1, java.awt.BorderLayout.PAGE_END);
    add(jPanel5, java.awt.BorderLayout.SOUTH);
    // NOI18N
    jTabbedPane1.setName("jTabbedPane1");
    generalSettings.setMinimumSize(new java.awt.Dimension(50, 50));
    // NOI18N
    generalSettings.setName("generalSettings");
    generalSettings.setOpaque(false);
    changeHighlightColor.setText("...");
    changeHighlightColor.setEnabled(false);
    // NOI18N
    changeHighlightColor.setName("changeHighlightColor");
    thickness.setEnabled(false);
    // NOI18N
    thickness.setName("thickness");
    thickness.addChangeListener(formListener);
    jLabel2.setText("Color");
    // NOI18N
    jLabel2.setName("jLabel2");
    arcHeight.setEnabled(false);
    // NOI18N
    arcHeight.setName("arcHeight");
    arcHeight.addChangeListener(formListener);
    changeSecondaryHighlightColor.setText("...");
    changeSecondaryHighlightColor.setEnabled(false);
    // NOI18N
    changeSecondaryHighlightColor.setName("changeSecondaryHighlightColor");
    changeSecondaryShadowColor.setText("...");
    changeSecondaryShadowColor.setEnabled(false);
    // NOI18N
    changeSecondaryShadowColor.setName("changeSecondaryShadowColor");
    shadowColor.setText("000000");
    shadowColor.setEnabled(false);
    // NOI18N
    shadowColor.setName("shadowColor");
    changeLineColor.setText("...");
    changeLineColor.setEnabled(false);
    // NOI18N
    changeLineColor.setName("changeLineColor");
    jLabel3.setText("Highlight Color");
    // NOI18N
    jLabel3.setName("jLabel3");
    secondaryShadowColor.setText("000000");
    secondaryShadowColor.setEnabled(false);
    // NOI18N
    secondaryShadowColor.setName("secondaryShadowColor");
    jLabel6.setText("Secondary");
    // NOI18N
    jLabel6.setName("jLabel6");
    jLabel4.setText("Shadow Color");
    // NOI18N
    jLabel4.setName("jLabel4");
    highlightColor.setText("000000");
    highlightColor.setEnabled(false);
    // NOI18N
    highlightColor.setName("highlightColor");
    jLabel12.setText("Thickness");
    // NOI18N
    jLabel12.setName("jLabel12");
    secondaryHighlightColor.setText("000000");
    secondaryHighlightColor.setEnabled(false);
    // NOI18N
    secondaryHighlightColor.setName("secondaryHighlightColor");
    arcWidth.setEnabled(false);
    // NOI18N
    arcWidth.setName("arcWidth");
    arcWidth.addChangeListener(formListener);
    raisedBorder.setEnabled(false);
    raisedBorder.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // NOI18N
    raisedBorder.setName("raisedBorder");
    raisedBorder.addActionListener(formListener);
    changeShadowColor.setText("...");
    changeShadowColor.setEnabled(false);
    // NOI18N
    changeShadowColor.setName("changeShadowColor");
    jLabel8.setText("Arc Width");
    // NOI18N
    jLabel8.setName("jLabel8");
    lineColor.setText("000000");
    lineColor.setEnabled(false);
    // NOI18N
    lineColor.setName("lineColor");
    jLabel9.setText("Arc Height");
    // NOI18N
    jLabel9.setName("jLabel9");
    themeColors.setText("Theme Colors");
    themeColors.setEnabled(false);
    // NOI18N
    themeColors.setName("themeColors");
    themeColors.addActionListener(formListener);
    jLabel7.setText("Raised");
    // NOI18N
    jLabel7.setName("jLabel7");
    jLabel5.setText("Secondary");
    // NOI18N
    jLabel5.setName("jLabel5");
    thicknessMillimeters.setText("Millimeters");
    // NOI18N
    thicknessMillimeters.setName("thicknessMillimeters");
    thicknessMillimeters.addActionListener(formListener);
    org.jdesktop.layout.GroupLayout generalSettingsLayout = new org.jdesktop.layout.GroupLayout(generalSettings);
    generalSettings.setLayout(generalSettingsLayout);
    generalSettingsLayout.setHorizontalGroup(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(generalSettingsLayout.createSequentialGroup().addContainerGap().add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jLabel2).add(jLabel12).add(jLabel8).add(jLabel3).add(jLabel4).add(jLabel7)).add(6, 6, 6).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(generalSettingsLayout.createSequentialGroup().add(highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(changeHighlightColor).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jLabel5).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(secondaryHighlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(changeSecondaryHighlightColor)).add(generalSettingsLayout.createSequentialGroup().add(shadowColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(changeShadowColor).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jLabel6).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(secondaryShadowColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(changeSecondaryShadowColor)).add(generalSettingsLayout.createSequentialGroup().add(thickness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(18, 18, 18).add(thicknessMillimeters)).add(raisedBorder).add(generalSettingsLayout.createSequentialGroup().add(arcWidth, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE).add(56, 56, 56).add(jLabel9).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(arcHeight, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)).add(generalSettingsLayout.createSequentialGroup().add(lineColor).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(changeLineColor).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(themeColors))).addContainerGap(41, Short.MAX_VALUE)));
    generalSettingsLayout.linkSize(new java.awt.Component[] { arcHeight, arcWidth, highlightColor, lineColor, secondaryHighlightColor, secondaryShadowColor, shadowColor }, org.jdesktop.layout.GroupLayout.HORIZONTAL);
    generalSettingsLayout.linkSize(new java.awt.Component[] { changeHighlightColor, changeLineColor, changeSecondaryHighlightColor, changeSecondaryShadowColor, changeShadowColor }, org.jdesktop.layout.GroupLayout.HORIZONTAL);
    generalSettingsLayout.setVerticalGroup(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(generalSettingsLayout.createSequentialGroup().add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER).add(jLabel2).add(lineColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(changeLineColor).add(themeColors)).add(3, 3, 3).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER).add(jLabel12).add(thickness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(thicknessMillimeters)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER).add(arcWidth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(jLabel8).add(jLabel9).add(arcHeight, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel3).add(highlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(changeHighlightColor).add(jLabel5).add(secondaryHighlightColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(changeSecondaryHighlightColor)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel4).add(shadowColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(changeShadowColor).add(jLabel6).add(secondaryShadowColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(changeSecondaryShadowColor)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(generalSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(raisedBorder).add(jLabel7)).add(0, 209, Short.MAX_VALUE)));
    jTabbedPane1.addTab("General", generalSettings);
    // NOI18N
    imageBorderSettings.setName("imageBorderSettings");
    imageMode.setText("3 Image Mode");
    imageMode.setEnabled(false);
    imageMode.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // NOI18N
    imageMode.setName("imageMode");
    imageMode.addActionListener(formListener);
    // NOI18N
    jPanel4.setName("jPanel4");
    jPanel4.setOpaque(false);
    jPanel4.setLayout(new java.awt.GridLayout(3, 3));
    // NOI18N
    topLeft.setName("topLeft");
    topLeft.addActionListener(formListener);
    jPanel4.add(topLeft);
    // NOI18N
    top.setName("top");
    top.addActionListener(formListener);
    jPanel4.add(top);
    // NOI18N
    topRight.setName("topRight");
    topRight.addActionListener(formListener);
    jPanel4.add(topRight);
    // NOI18N
    left.setName("left");
    left.addActionListener(formListener);
    jPanel4.add(left);
    // NOI18N
    center.setName("center");
    center.addActionListener(formListener);
    jPanel4.add(center);
    // NOI18N
    right.setName("right");
    right.addActionListener(formListener);
    jPanel4.add(right);
    // NOI18N
    bottomLeft.setName("bottomLeft");
    bottomLeft.addActionListener(formListener);
    jPanel4.add(bottomLeft);
    // NOI18N
    bottom.setName("bottom");
    bottom.addActionListener(formListener);
    jPanel4.add(bottom);
    // NOI18N
    bottomRight.setName("bottomRight");
    bottomRight.addActionListener(formListener);
    jPanel4.add(bottomRight);
    org.jdesktop.layout.GroupLayout imageBorderSettingsLayout = new org.jdesktop.layout.GroupLayout(imageBorderSettings);
    imageBorderSettings.setLayout(imageBorderSettingsLayout);
    imageBorderSettingsLayout.setHorizontalGroup(imageBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(imageBorderSettingsLayout.createSequentialGroup().addContainerGap().add(imageBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(imageBorderSettingsLayout.createSequentialGroup().add(imageMode).add(0, 0, Short.MAX_VALUE)).add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE)).addContainerGap()));
    imageBorderSettingsLayout.setVerticalGroup(imageBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(org.jdesktop.layout.GroupLayout.TRAILING, imageBorderSettingsLayout.createSequentialGroup().addContainerGap().add(imageMode).addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 127, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap(214, Short.MAX_VALUE)));
    jTabbedPane1.addTab("Image", imageBorderSettings);
    // NOI18N
    roundBorderSettings.setName("roundBorderSettings");
    jLabel10.setText("Opacity");
    // NOI18N
    jLabel10.setName("jLabel10");
    jLabel11.setText("Stroke Color");
    // NOI18N
    jLabel11.setName("jLabel11");
    jLabel13.setText("Stroke Opacity");
    // NOI18N
    jLabel13.setName("jLabel13");
    jLabel14.setText("Stroke Thickness");
    // NOI18N
    jLabel14.setName("jLabel14");
    jLabel15.setText("Shadow Opacity");
    // NOI18N
    jLabel15.setName("jLabel15");
    strokeMillimeter.setText("In Millimeters");
    strokeMillimeter.setToolTipText("Is the thickness in millimeters or pixels");
    // NOI18N
    strokeMillimeter.setName("strokeMillimeter");
    strokeMillimeter.addActionListener(formListener);
    jLabel16.setText("Shadow Spread");
    // NOI18N
    jLabel16.setName("jLabel16");
    jLabel17.setText("Shadow X");
    // NOI18N
    jLabel17.setName("jLabel17");
    jLabel18.setText("Shadow Y");
    // NOI18N
    jLabel18.setName("jLabel18");
    jLabel19.setText("Shadow Blur");
    // NOI18N
    jLabel19.setName("jLabel19");
    jLabel20.setText("Rectangle");
    // NOI18N
    jLabel20.setName("jLabel20");
    // NOI18N
    strokeThickness.setName("strokeThickness");
    strokeThickness.addChangeListener(formListener);
    // NOI18N
    opacity.setName("opacity");
    opacity.addChangeListener(formListener);
    strokeColor.setText("0");
    // NOI18N
    strokeColor.setName("strokeColor");
    strokeColor.addActionListener(formListener);
    strokeColorPicker.setText("...");
    // NOI18N
    strokeColorPicker.setName("strokeColorPicker");
    // NOI18N
    strokeOpacity.setName("strokeOpacity");
    strokeOpacity.addChangeListener(formListener);
    // NOI18N
    shadowOpacity.setName("shadowOpacity");
    shadowOpacity.addChangeListener(formListener);
    // NOI18N
    shadowSpread.setName("shadowSpread");
    shadowSpread.addChangeListener(formListener);
    // NOI18N
    shadowX.setName("shadowX");
    shadowX.addChangeListener(formListener);
    // NOI18N
    shadowY.setName("shadowY");
    shadowY.addChangeListener(formListener);
    // NOI18N
    shadowBlur.setName("shadowBlur");
    shadowBlur.addChangeListener(formListener);
    // NOI18N
    isRectangle.setName("isRectangle");
    isRectangle.addActionListener(formListener);
    jLabel21.setText("Background Color");
    // NOI18N
    jLabel21.setName("jLabel21");
    backgroundColor.setText("d32f2f");
    // NOI18N
    backgroundColor.setName("backgroundColor");
    backgroundColor.addActionListener(formListener);
    backgroundColorPicker.setText("...");
    // NOI18N
    backgroundColorPicker.setName("backgroundColorPicker");
    org.jdesktop.layout.GroupLayout roundBorderSettingsLayout = new org.jdesktop.layout.GroupLayout(roundBorderSettings);
    roundBorderSettings.setLayout(roundBorderSettingsLayout);
    roundBorderSettingsLayout.setHorizontalGroup(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(roundBorderSettingsLayout.createSequentialGroup().addContainerGap().add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jLabel14).add(jLabel10).add(jLabel11).add(jLabel13).add(jLabel15).add(jLabel16).add(jLabel17).add(jLabel18).add(jLabel19).add(jLabel20).add(jLabel21)).addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(org.jdesktop.layout.GroupLayout.TRAILING, roundBorderSettingsLayout.createSequentialGroup().add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING).add(org.jdesktop.layout.GroupLayout.LEADING, shadowX).add(shadowSpread).add(org.jdesktop.layout.GroupLayout.LEADING, shadowY).add(org.jdesktop.layout.GroupLayout.LEADING, shadowBlur)).add(130, 130, 130)).add(roundBorderSettingsLayout.createSequentialGroup().add(isRectangle).addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).add(org.jdesktop.layout.GroupLayout.TRAILING, roundBorderSettingsLayout.createSequentialGroup().add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING).add(roundBorderSettingsLayout.createSequentialGroup().add(backgroundColor).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(backgroundColorPicker)).add(org.jdesktop.layout.GroupLayout.LEADING, roundBorderSettingsLayout.createSequentialGroup().add(strokeColor, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(strokeColorPicker)).add(org.jdesktop.layout.GroupLayout.LEADING, strokeThickness).add(org.jdesktop.layout.GroupLayout.LEADING, opacity).add(org.jdesktop.layout.GroupLayout.LEADING, strokeOpacity).add(org.jdesktop.layout.GroupLayout.LEADING, shadowOpacity)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(strokeMillimeter).addContainerGap()))));
    roundBorderSettingsLayout.setVerticalGroup(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(org.jdesktop.layout.GroupLayout.TRAILING, roundBorderSettingsLayout.createSequentialGroup().addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel21).add(backgroundColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(backgroundColorPicker)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel10).add(opacity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel11).add(strokeColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(strokeColorPicker)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel13).add(strokeOpacity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel14).add(strokeMillimeter).add(strokeThickness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel15).add(shadowOpacity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel16).add(shadowSpread, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel17).add(shadowX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel18).add(shadowY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel19).add(shadowBlur, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(roundBorderSettingsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel20).add(isRectangle)).add(15, 15, 15)));
    jTabbedPane1.addTab("Round", roundBorderSettings);
    // NOI18N
    jPanel2.setName("jPanel2");
    jLabel22.setText("Stroke Color");
    // NOI18N
    jLabel22.setName("jLabel22");
    rrStrokeColor.setText("0");
    // NOI18N
    rrStrokeColor.setName("rrStrokeColor");
    rrStrokeColor.addActionListener(formListener);
    rrStrokeColorPicker.setText("...");
    // NOI18N
    rrStrokeColorPicker.setName("rrStrokeColorPicker");
    rrStrokeColorPicker.addActionListener(formListener);
    jLabel23.setText("Stroke Opacity");
    // NOI18N
    jLabel23.setName("jLabel23");
    // NOI18N
    rrStrokeOpacity.setName("rrStrokeOpacity");
    rrStrokeOpacity.addChangeListener(formListener);
    jLabel24.setText("Stroke Thickness");
    // NOI18N
    jLabel24.setName("jLabel24");
    // NOI18N
    rrStrokeThickness.setName("rrStrokeThickness");
    rrStrokeThickness.addChangeListener(formListener);
    rrStrokeMillimeter.setText("In Millimeters");
    rrStrokeMillimeter.setToolTipText("Is the thickness in millimeters or pixels");
    // NOI18N
    rrStrokeMillimeter.setName("rrStrokeMillimeter");
    rrStrokeMillimeter.addActionListener(formListener);
    jLabel25.setText("Shadow Opacity");
    // NOI18N
    jLabel25.setName("jLabel25");
    // NOI18N
    rrShadowOpacity.setName("rrShadowOpacity");
    rrShadowOpacity.addChangeListener(formListener);
    jLabel26.setText("Shadow Spread");
    // NOI18N
    jLabel26.setName("jLabel26");
    // NOI18N
    rrShadowSpread.setName("rrShadowSpread");
    rrShadowSpread.addChangeListener(formListener);
    jLabel27.setText("Shadow X");
    // NOI18N
    jLabel27.setName("jLabel27");
    // NOI18N
    rrShadowX.setName("rrShadowX");
    rrShadowX.addChangeListener(formListener);
    jLabel28.setText("Shadow Y");
    // NOI18N
    jLabel28.setName("jLabel28");
    // NOI18N
    rrShadowY.setName("rrShadowY");
    rrShadowY.addChangeListener(formListener);
    jLabel29.setText("Shadow Blur");
    // NOI18N
    jLabel29.setName("jLabel29");
    // NOI18N
    rrShadowBlur.setName("rrShadowBlur");
    rrShadowBlur.addChangeListener(formListener);
    jLabel30.setText("Radius Millimeters");
    // NOI18N
    jLabel30.setName("jLabel30");
    // NOI18N
    rrRadius.setName("rrRadius");
    rrRadius.addChangeListener(formListener);
    jLabel31.setText("Bezier Corners");
    // NOI18N
    jLabel31.setName("jLabel31");
    // NOI18N
    rrBezier.setName("rrBezier");
    rrBezier.addActionListener(formListener);
    jLabel32.setText("Mode");
    // NOI18N
    jLabel32.setName("jLabel32");
    rrMode.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Standard", "Top Only", "Bottom Only" }));
    // NOI18N
    rrMode.setName("rrMode");
    rrMode.addActionListener(formListener);
    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jPanel2Layout.createSequentialGroup().addContainerGap().add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jLabel24).add(jLabel22).add(jLabel23).add(jLabel25).add(jLabel26).add(jLabel27).add(jLabel28).add(jLabel29).add(jLabel30).add(jLabel31).add(jLabel32)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jPanel2Layout.createSequentialGroup().add(rrStrokeThickness).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(rrStrokeMillimeter)).add(jPanel2Layout.createSequentialGroup().add(rrBezier).add(0, 0, Short.MAX_VALUE)).add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup().add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING).add(org.jdesktop.layout.GroupLayout.LEADING, rrMode, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).add(org.jdesktop.layout.GroupLayout.LEADING, rrStrokeOpacity).add(org.jdesktop.layout.GroupLayout.LEADING, rrShadowOpacity).add(org.jdesktop.layout.GroupLayout.LEADING, rrShadowSpread).add(org.jdesktop.layout.GroupLayout.LEADING, rrShadowX).add(org.jdesktop.layout.GroupLayout.LEADING, rrShadowY).add(org.jdesktop.layout.GroupLayout.LEADING, rrShadowBlur).add(org.jdesktop.layout.GroupLayout.LEADING, rrRadius).add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2Layout.createSequentialGroup().add(rrStrokeColor, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(rrStrokeColorPicker))).add(124, 124, 124))).addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jPanel2Layout.createSequentialGroup().addContainerGap().add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel30).add(rrRadius, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel22).add(rrStrokeColor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(rrStrokeColorPicker)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel23).add(rrStrokeOpacity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel24).add(rrStrokeMillimeter).add(rrStrokeThickness, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel25).add(rrShadowOpacity, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel26).add(rrShadowSpread, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel27).add(rrShadowX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel28).add(rrShadowY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel29).add(rrShadowBlur, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel31).add(rrBezier)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(jLabel32).add(rrMode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)).addContainerGap(44, Short.MAX_VALUE)));
    jTabbedPane1.addTab("Round Rect", jPanel2);
    add(jTabbedPane1, java.awt.BorderLayout.CENTER);
}
Also used : JTextField(javax.swing.JTextField) JComboBox(javax.swing.JComboBox) JButton(javax.swing.JButton) CodenameOneComponentWrapper(com.codename1.ui.resource.util.CodenameOneComponentWrapper)

Aggregations

Stroke (com.codename1.ui.Stroke)4 GeneralPath (com.codename1.ui.geom.GeneralPath)3 Paint (com.codename1.charts.compat.Paint)2 Image (com.codename1.ui.Image)2 Rectangle (com.codename1.ui.geom.Rectangle)2 CodenameOneComponentWrapper (com.codename1.ui.resource.util.CodenameOneComponentWrapper)2 JButton (javax.swing.JButton)2 Bitmap (android.graphics.Bitmap)1 Canvas (android.graphics.Canvas)1 Matrix (android.graphics.Matrix)1 Paint (android.graphics.Paint)1 Path (android.graphics.Path)1 RectF (android.graphics.RectF)1 Style (com.codename1.charts.compat.Paint.Style)1 Point (com.codename1.charts.models.Point)1 BasicStroke (com.codename1.charts.renderers.BasicStroke)1 Button (com.codename1.ui.Button)1 PathIterator (com.codename1.ui.geom.PathIterator)1 Border (com.codename1.ui.plaf.Border)1 RoundBorder (com.codename1.ui.plaf.RoundBorder)1