Creates new JCellButton.
@param iMaxLength The number of columns of text in this field.
@param bAlignRight If true, align the text to the right.
181813
public void init(Convert converter)
    {
        m_converter = converter;
        if (converter != null)
            this.setColumns(converter.getMaxLength());
    }
102328
public static <T extends ISized & IChild<U>, U extends ISized> IntSupplier rightAligned(T owner, int spacing)
	{

		return () -> {
			U parent = owner.getParent();
			if (parent == null)
				return 0;
			return parent.size().width() - owner.size().width() - Padding.of(parent).right() - spacing;
		};
	}
120726
@Override
    public final AbstractGauge init(int WIDTH, int HEIGHT) {
        if (WIDTH <= 1 || HEIGHT <= 1) {
            return this;
        }

        if (isDigitalFont()) {
            setLcdValueFont(getModel().getDigitalBaseFont().deriveFont(0.7f * WIDTH * 0.10f));
        } else {
            setLcdValueFont(getModel().getStandardBaseFont().deriveFont(0.625f * WIDTH * 0.10f));
        }

        if (isCustomLcdUnitFontEnabled()) {
            setLcdUnitFont(getCustomLcdUnitFont().deriveFont(0.25f * WIDTH * 0.10f));
        } else {
            setLcdUnitFont(getModel().getStandardBaseFont().deriveFont(0.25f * WIDTH * 0.10f));
        }

        setLcdInfoFont(getModel().getStandardInfoFont().deriveFont(0.15f * WIDTH * 0.10f));

        CENTER.setLocation(getGaugeBounds().getCenterX() - getInsets().left, getGaugeBounds().getCenterY() - getInsets().top);

        if (frameImage != null) {
            frameImage.flush();
        }
        frameImage = create_FRAME_Image(WIDTH);

        if (backgroundImage != null) {
            backgroundImage.flush();
        }
        backgroundImage = create_BACKGROUND_Image(WIDTH);

        if (lcdImage != null) {
            lcdImage.flush();
        }
        lcdImage = create_LCD_Image((int) (WIDTH * 0.32), (int) (WIDTH * 0.10), getLcdColor(), getCustomLcdBackground());
        LCD.setRect(((getGaugeBounds().width - lcdImage.getWidth()) / 2.0), ((getGaugeBounds().height - lcdImage.getHeight()) / 2.0), WIDTH * 0.32, WIDTH * 0.10);

        if (tickmarksImage != null) {
            tickmarksImage.flush();
        }
        tickmarksImage = create_TICKMARKS_Image(WIDTH);

        if (overlayImage != null) {
            overlayImage.flush();
        }
        overlayImage = create_OVERLAY_Image(WIDTH);

        if (pointerImage != null) {
            pointerImage.flush();
        }
        pointerImage = create_POINTER_Image(WIDTH);

        if (foregroundImage != null) {
            foregroundImage.flush();
        }
        foregroundImage = create_FOREGROUND_Image(WIDTH, false, getForegroundType());

        if (disabledImage != null) {
            disabledImage.flush();
        }
        disabledImage = create_DISABLED_Image(WIDTH);

        return this;
    }
768145
public static OrientationHelperEx createHorizontalHelper(
        ExposeLinearLayoutManagerEx layoutManager) {
        return new OrientationHelperEx(layoutManager) {
            @Override
            public int getEndAfterPadding() {
                return mLayoutManager.getWidth() - mLayoutManager.getPaddingRight();
            }

            @Override
            public int getEnd() {
                return mLayoutManager.getWidth();
            }

            @Override
            public void offsetChildren(int amount) {
                mLayoutManager.offsetChildrenHorizontal(amount);
            }

            @Override
            public int getStartAfterPadding() {
                return mLayoutManager.getPaddingLeft();
            }

            @Override
            public int getDecoratedMeasurement(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedMeasuredWidth(view) + params.leftMargin
                    + params.rightMargin : mLayoutManager.getDecoratedMeasuredWidth(view);
            }

            @Override
            public int getDecoratedMeasurementInOther(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return mLayoutManager.getDecoratedMeasuredHeight(view) + params.topMargin + params.bottomMargin;
            }

            @Override
            public int getDecoratedEnd(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedRight(view)
                    + params.rightMargin : mLayoutManager.getDecoratedRight(view);
            }

            @Override
            public int getDecoratedStart(View view) {
                final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
                    view.getLayoutParams();
                return !mLayoutManager.isEnableMarginOverLap() ? mLayoutManager.getDecoratedLeft(view)
                    - params.leftMargin : mLayoutManager.getDecoratedLeft(view);
            }

            @Override
            public int getTotalSpace() {
                return mLayoutManager.getWidth() - mLayoutManager.getPaddingLeft()
                    - mLayoutManager.getPaddingRight();
            }

            @Override
            public void offsetChild(View view, int offset) {
                view.offsetLeftAndRight(offset);
            }

            @Override
            public int getEndPadding() {
                return mLayoutManager.getPaddingRight();
            }
        };
    }
253598
protected JButton createLeftOneTouchButton() {
        SeaGlassArrowButton b            = new SeaGlassArrowButton(SwingConstants.NORTH);
        int                 oneTouchSize = lookupOneTouchSize();

        b.setName("SplitPaneDivider.leftOneTouchButton");
        b.setMinimumSize(new Dimension(oneTouchSize, oneTouchSize));
        b.setCursor(Cursor.getPredefinedCursor(
            splitPane.getOrientation() == 
                JSplitPane.HORIZONTAL_SPLIT ? 
                        Cursor.W_RESIZE_CURSOR:Cursor.N_RESIZE_CURSOR));
        b.setFocusPainted(false);
        b.setBorderPainted(false);
        b.setRequestFocusEnabled(false);
        b.setDirection(mapDirection(true));

        return b;
    }
1147306
boolean willLabelsFitInTickSpaceHint(List<String> tickLabels, int tickSpacingHint) {

    // Assume that for Y-Axis the ticks will all fit based on their tickSpace hint because the text
    // is usually horizontal and "short". This more applies to the X-Axis.
    if (this.axisDirection == Direction.Y) {
      return true;
    }

    String sampleLabel = " ";
    // find the longest String in all the labels
    for (String tickLabel : tickLabels) {
      if (tickLabel != null && tickLabel.length() > sampleLabel.length()) {
        sampleLabel = tickLabel;
      }
    }
    // System.out.println("longestLabel: " + sampleLabel);

    TextLayout textLayout =
        new TextLayout(
            sampleLabel, styler.getAxisTickLabelsFont(), new FontRenderContext(null, true, false));
    AffineTransform rot =
        styler.getXAxisLabelRotation() == 0
            ? null
            : AffineTransform.getRotateInstance(
                -1 * Math.toRadians(styler.getXAxisLabelRotation()));
    Shape shape = textLayout.getOutline(rot);
    Rectangle2D rectangle = shape.getBounds();
    double largestLabelWidth = rectangle.getWidth();
    // System.out.println("largestLabelWidth: " + largestLabelWidth);
    // System.out.println("tickSpacingHint: " + tickSpacingHint);

    // if (largestLabelWidth * 1.1 >= tickSpacingHint) {
    // System.out.println("WILL NOT FIT!!!");
    // }

    return (largestLabelWidth * 1.1 < tickSpacingHint);
  }
1020019
public static void fullViewLeft(int imageWidth,int imageHeight,
									FMatrixRMaj rectifyLeft, FMatrixRMaj rectifyRight )
	{
		ImplRectifyImageOps_F32.fullViewLeft(imageWidth, imageHeight, rectifyLeft, rectifyRight);
	}
1280427
public static void setButtonDimensionHint(Button button) {
		Assert.isNotNull(button);
		Object gd= button.getLayoutData();
		if (gd instanceof GridData) {
			((GridData)gd).widthHint= getButtonWidthHint(button);
			((GridData)gd).horizontalAlignment = GridData.FILL;
		}
	}
465740
protected CmsFormRow createRow(String labelText, String description, Widget widget) {

        return createRow(labelText, description, widget, null, false);
    }
494089
private LayoutManager createLayout() {
        SeaGlassContext context = getContext(this);
        LayoutManager   lm      = (LayoutManager) style.get(context, "InternalFrameTitlePane.titlePaneLayout");

        context.dispose();

        return (lm != null) ? lm : new SeaGlassTitlePaneLayout();
    }
1263267
public AT_Context setFrameLeftRightMargin(int frameLeft, int frameRight){
		if(frameRight>-1 && frameLeft>-1){
			this.frameLeftMargin = frameLeft;
			this.frameRightMargin = frameRight;
		}
		return this;
	}
1323181
function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {
    var valueDim = opt.valueDim;
    var symbolBoundingData = itemModel.get('symbolBoundingData');
    var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());
    var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));
    var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);
    var boundingLength;

    if (zrUtil.isArray(symbolBoundingData)) {
        var symbolBoundingExtent = [
            convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,
            convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx
        ];
        symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());
        boundingLength = symbolBoundingExtent[pxSignIdx];
    }
    else if (symbolBoundingData != null) {
        boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;
    }
    else if (symbolRepeat) {
        boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;
    }
    else {
        boundingLength = layout[valueDim.wh];
    }

    output.boundingLength = boundingLength;

    if (symbolRepeat) {
        output.repeatCutLength = layout[valueDim.wh];
    }

    output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;
}
845947
private void jButtonAceptGnuPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptGnuPActionPerformed

        if (!this.jTextFieldResultPath.getText().equals("")) {
            String outPath = getDirectory("open", JFileChooser.DIRECTORIES_ONLY);
            if(!outPath.equals("")){
                
            File resultFile = new File(this.jTextFieldResultPath.getText());
            String resultDirectory = resultFile.getAbsolutePath();
            String gnuPlotPath = this.jTextFieldGNUPath.getText();
            String gnuplotScriptPath = null;
            File gnuplotDir = new File(gnuPlotPath);
            if (!gnuplotDir.exists()) {
                JOptionPane.showMessageDialog(this, "Gnuplot directory not found: " + gnuPlotPath, "Error", JOptionPane.ERROR_MESSAGE);
                return;
            }
            String algShortName[] = new String[this.jTableAlgoritms.getRowCount()];
            String algName[] = new String[this.jTableAlgoritms.getRowCount()];
            for (int i = 0; i < this.jTableStreams.getRowCount(); i++) {
                String streamName = this.jTableStreams.getModel().getValueAt(i, 0).toString();
                String streamShortName = this.jTableStreams.getModel().getValueAt(i, 1).toString();
                for (int j = 0; j < this.jTableAlgoritms.getRowCount(); j++) {
                    algName[j] = this.jTableAlgoritms.getModel().getValueAt(j, 0).toString();
                    algShortName[j] = this.jTableAlgoritms.getModel().getValueAt(j, 1).toString();
                    File inputFile = new File(FilenameUtils.separatorsToSystem(
                            this.path + "\\" + streamName + "\\" + algName[j]));

                    if (!inputFile.exists()) {
                        JOptionPane.showMessageDialog(this, "File not found: "
                                + inputFile.getAbsolutePath(),
                                "Error", JOptionPane.ERROR_MESSAGE);
                        return;
                    }

                }

                gnuplotScriptPath = resultDirectory + File.separator
                        + resultFile.getName() + ".plt";
                String script = createScript(streamName, algName, algShortName, outPath);
                File scriptFile = writeScriptToFile(gnuplotScriptPath, script);
                String gnuplotCommand = gnuPlotPath + File.separator + "gnuplot \""
                        + gnuplotScriptPath + "\"";
                String line, gnuplotOutput = "";
                try {
                    Process p = Runtime.getRuntime().exec(gnuplotCommand);

                    BufferedReader err = new BufferedReader(new InputStreamReader(p
                            .getErrorStream()));
                    while ((line = err.readLine()) != null) {
                        gnuplotOutput += line + System.getProperty("line.separator");
                    }
                    err.close();
                } catch (IOException ex) {
                    JOptionPane.showMessageDialog(this, "Error while executing gnuplot script",
                            "Error", JOptionPane.ERROR_MESSAGE);
                    throw new RuntimeException("Error while executing gnuplot script:"
                            + scriptFile, ex);

                }
                if (this.jCheckBoxDeleteScript.isSelected()) {
                    scriptFile.delete();
                }
            }

            //Completed
            JOptionPane.showMessageDialog(this, "Figures created at " + (new File(resultFile.getAbsolutePath())).getParent(),
                    "", JOptionPane.INFORMATION_MESSAGE);
        }
        } else {
            JOptionPane.showMessageDialog(this, "Plot output file option not set!",
                    "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
1233457
public JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan)
    {
        ((SwingBindingFactory) getBindingFactory()).interceptBinding(binding);
        JComponent component = binding.getControl();
        addComponent(component, column, row, widthSpan, heightSpan);
        return component;
    }
1165093
public String buttonBarLineSpacer(int pixel) {

        StringBuffer result = new StringBuffer(128);
        result.append(
            "<td><span class=\"norm\"><span unselectable=\"on\" class=\"txtbutton\" style=\"padding-right: 0px; padding-left: ");
        result.append(pixel);
        result.append("px;\"></span></span></td>\n");
        return result.toString();
    }
682967
@Override
    public final AbstractGauge init(final int WIDTH, final int HEIGHT) {
        if (WIDTH <= 1 || HEIGHT <= 1) {
            return this;
        }

        // Create Background Image
        if (bImage != null) {
            bImage.flush();
        }
        bImage = UTIL.createImage(WIDTH, HEIGHT, Transparency.TRANSLUCENT);

        // Create Foreground Image
        if (fImage != null) {
            fImage.flush();
        }
        fImage = UTIL.createImage(WIDTH, HEIGHT, Transparency.TRANSLUCENT);

        if (isLcdVisible()) {
            final float LCD_TEXT_HEIGHT_BASE;
            if (getOrientation() == Orientation.HORIZONTAL) {
                LCD_TEXT_HEIGHT_BASE = HEIGHT * 0.15f;
            } else {
                LCD_TEXT_HEIGHT_BASE = HEIGHT * 0.055f;
            }
            if (isDigitalFont()) {
                setLcdValueFont(LCD_DIGITAL_FONT.deriveFont(0.7f * LCD_TEXT_HEIGHT_BASE));
            } else {
                setLcdValueFont(LCD_STANDARD_FONT.deriveFont(0.625f * LCD_TEXT_HEIGHT_BASE));
            }

            if (isCustomLcdUnitFontEnabled()) {
                setLcdUnitFont(getCustomLcdUnitFont().deriveFont(0.25f * LCD_TEXT_HEIGHT_BASE));
            } else {
                setLcdUnitFont(LCD_STANDARD_FONT.deriveFont(0.25f * LCD_TEXT_HEIGHT_BASE));
            }

            setLcdInfoFont(getModel().getStandardInfoFont().deriveFont(0.15f * LCD_TEXT_HEIGHT_BASE));
        }
        if (isFrameVisible()) {
            create_FRAME_Image(WIDTH, HEIGHT, bImage);
        }

        if (isBackgroundVisible()) {
            create_BACKGROUND_Image(WIDTH, HEIGHT, bImage);
        }

        if (isGlowVisible()) {
            if (glowImageOff != null) {
                glowImageOff.flush();
            }
            glowImageOff = create_GLOW_Image(WIDTH, HEIGHT, getGlowColor(), false);
            if (glowImageOn != null) {
                glowImageOn.flush();
            }
            glowImageOn = create_GLOW_Image(WIDTH, HEIGHT, getGlowColor(), true);
        } else {
            setGlowPulsating(false);
        }

        if (isTrackVisible()) {
            create_TRACK_Image(WIDTH, HEIGHT, getMinValue(), getMaxValue(), getTrackStart(), getTrackSection(), getTrackStop(), getTrackStartColor(), getTrackSectionColor(), getTrackStopColor(), bImage);
        }

        TICKMARK_FACTORY.create_LINEAR_TICKMARKS_Image(WIDTH,
                                                       HEIGHT,
                                                       getModel().getNiceMinValue(),
                                                       getModel().getNiceMaxValue(),
                                                       getModel().getMaxNoOfMinorTicks(),
                                                       getModel().getMaxNoOfMajorTicks(),
                                                       getModel().getMinorTickSpacing(),
                                                       getModel().getMajorTickSpacing(),
                                                       getMinorTickmarkType(),
                                                       getMajorTickmarkType(),
                                                       isTickmarksVisible(),
                                                       isTicklabelsVisible(),
                                                       getModel().isMinorTickmarksVisible(),
                                                       getModel().isMajorTickmarksVisible(),
                                                       getLabelNumberFormat(),
                                                       isTickmarkSectionsVisible(),
                                                       getBackgroundColor(),
                                                       getTickmarkColor(),
                                                       isTickmarkColorFromThemeEnabled(),
                                                       getTickmarkSections(),
                                                       new Point2D.Double(0, 0),
                                                       getOrientation(),
                                                       getModel().isNiceScale(),
                                                       getModel().isLogScale(),
                                                       bImage);

        if (isTitleVisible()) {
            create_TITLE_Image(WIDTH, HEIGHT, getModel().isUnitVisible(), bImage);
        }

        if (isLcdVisible()) {
            switch (getOrientation()) {
                case HORIZONTAL:
                    // Horizontal
                    if (isLcdBackgroundVisible()) {
                    create_LCD_Image(new Rectangle2D.Double((WIDTH * 0.695), (HEIGHT * 0.22), (WIDTH * 0.18), (HEIGHT * 0.15)), getLcdColor(), getCustomLcdBackground(), bImage);
                    }
                    LCD.setRect((WIDTH * 0.695), (HEIGHT * 0.22), WIDTH * 0.18, HEIGHT * 0.15);
                    break;

                case VERTICAL:
                    if (isLcdBackgroundVisible()) {
                    create_LCD_Image(new Rectangle2D.Double(((WIDTH - (WIDTH * 0.5714285714)) / 2.0), (HEIGHT * 0.875), (WIDTH * 0.5714285714), (HEIGHT * 0.055)), getLcdColor(), getCustomLcdBackground(), bImage);
                    }
                    LCD.setRect(((WIDTH - (WIDTH * 0.5714285714)) / 2.0), (HEIGHT * 0.875), WIDTH * 0.5714285714, HEIGHT * 0.055);
                    break;
            }
            // Create the lcd threshold indicator image
            if (lcdThresholdImage != null) {
                lcdThresholdImage.flush();
            }
            lcdThresholdImage = create_LCD_THRESHOLD_Image((int) (LCD.getHeight() * 0.2045454545), (int) (LCD.getHeight() * 0.2045454545), getLcdColor().TEXT_COLOR);
        }

        if (thresholdImage != null) {
            thresholdImage.flush();
        }
        thresholdImage = create_THRESHOLD_Image(WIDTH, HEIGHT);

        if (minMeasuredImage != null) {
            minMeasuredImage.flush();
        }
        minMeasuredImage = create_MEASURED_VALUE_Image(WIDTH, HEIGHT, new Color(0, 23, 252, 255));

        if (maxMeasuredImage != null) {
            maxMeasuredImage.flush();
        }
        maxMeasuredImage = create_MEASURED_VALUE_Image(WIDTH, HEIGHT, new Color(252, 29, 0, 255));

        if (isForegroundVisible()) {
            FOREGROUND_FACTORY.createLinearForeground(WIDTH, HEIGHT, false, fImage);
        }

        if (disabledImage != null) {
            disabledImage.flush();
        }
        disabledImage = create_DISABLED_Image(WIDTH, HEIGHT);

        setCurrentLedImage(getLedImageOff());

        return this;
    }
1255893
public void onComponentRightClicked(final ComponentBuilder componentBuilder, final MouseEvent me) {
        final boolean isMultiStream = componentBuilder.getDescriptor().isMultiStreamComponent();

        final JPopupMenu popup = new JPopupMenu();

        final JMenuItem configureComponentMenuItem = new JMenuItem("Configure ...",
                ImageManager.get().getImageIcon(IconUtils.MENU_OPTIONS, IconUtils.ICON_SIZE_SMALL));
        configureComponentMenuItem.addActionListener(e -> _actions.showConfigurationDialog(componentBuilder));
        popup.add(configureComponentMenuItem);

        if (!isMultiStream && componentBuilder instanceof InputColumnSourceJob
                || componentBuilder instanceof HasFilterOutcomes) {
            popup.add(createLinkMenuItem(componentBuilder));
        }

        for (final OutputDataStream dataStream : componentBuilder.getOutputDataStreams()) {
            final JobGraphLinkPainter.VertexContext vertexContext =
                    new JobGraphLinkPainter.VertexContext(componentBuilder,
                            componentBuilder.getOutputDataStreamJobBuilder(dataStream), dataStream);
            popup.add(createLinkMenuItem(vertexContext));
        }

        final Icon renameIcon = ImageManager.get().getImageIcon(IconUtils.ACTION_RENAME, IconUtils.ICON_SIZE_SMALL);
        final JMenuItem renameMenuItem = WidgetFactory.createMenuItem("Rename component", renameIcon);
        renameMenuItem.addActionListener(new DefaultRenameComponentActionListener(componentBuilder, _graphContext));
        popup.add(renameMenuItem);

        if (!isMultiStream && componentBuilder instanceof TransformerComponentBuilder) {
            final TransformerComponentBuilder<?> tjb = (TransformerComponentBuilder<?>) componentBuilder;
            final JMenuItem previewMenuItem = new JMenuItem("Preview data",
                    ImageManager.get().getImageIcon(IconUtils.ACTION_PREVIEW, IconUtils.ICON_SIZE_SMALL));
            previewMenuItem.addActionListener(new PreviewTransformedDataActionListener(_windowContext, tjb));
            previewMenuItem.setEnabled(componentBuilder.isConfigured());
            popup.add(previewMenuItem);
        }

        if (ChangeRequirementMenu.isRelevant(componentBuilder)) {
            popup.add(new ChangeRequirementMenu(componentBuilder));
        }
        popup.addSeparator();
        popup.add(new RemoveComponentMenuItem(componentBuilder));
        popup.show(_graphContext.getVisualizationViewer(), me.getX(), me.getY());
    }