Get the appropriate shape for the specified type of chat.

@param r the rectangle bounding the chat label.
@param b the rectangle bounding the chat label and icon.
181444
public Shape getSubtitleShape (int type, Rectangle r, Rectangle b)
    {
        int placeType = placeOf(type);
        switch (placeType) {
        case SPECIALIZED:
        case PLACE:
            return getPlaceSubtitleShape(type, r);

        case TELL: {
            // lightning box!
            int halfy = r.y + r.height/2;
            Polygon p = new Polygon();
            p.addPoint(r.x - PAD - 2, r.y);
            p.addPoint(r.x - PAD / 2 - 2, halfy);
            p.addPoint(r.x - PAD, halfy);
            p.addPoint(r.x - PAD / 2, r.y + r.height);
            p.addPoint(r.x + r.width + PAD + 2, r.y + r.height);
            p.addPoint(r.x + r.width + PAD / 2 + 2, halfy);
            p.addPoint(r.x + r.width + PAD, halfy);
            p.addPoint(r.x + r.width + PAD / 2, r.y);
            return p;
        }

        case TELLFEEDBACK: {
            // reverse-lightning box!
            int halfy = r.y + r.height/2;
            Polygon p = new Polygon();
            p.addPoint(r.x - PAD - 2, r.y + r.height);
            p.addPoint(r.x - PAD / 2 - 2, halfy);
            p.addPoint(r.x - PAD, halfy);
            p.addPoint(r.x - PAD / 2, r.y);
            p.addPoint(r.x + r.width + PAD + 2, r.y);
            p.addPoint(r.x + r.width + PAD / 2 + 2, halfy);
            p.addPoint(r.x + r.width + PAD, halfy);
            p.addPoint(r.x + r.width + PAD / 2, r.y + r.height);
            return p;
        }

        case FEEDBACK: {
            // slanted box subtitle
            Polygon p = new Polygon();
            p.addPoint(r.x - PAD / 2, r.y);
            p.addPoint(r.x + r.width + PAD, r.y);
            p.addPoint(r.x + r.width + PAD / 2, r.y + r.height);
            p.addPoint(r.x - PAD, r.y + r.height);
            return p;
        }

        case BROADCAST:
        case CONTINUATION:
        case INFO:
        case ATTENTION:
        default: {
            Rectangle grown = new Rectangle(r);
            grown.grow(PAD, 0);
            return new Area(grown);
        }
        }
    }
951932
public static boolean isRowVectorShape(DataBuffer shapeInfo) {
        int rank = Shape.rank(shapeInfo);
        DataBuffer shape = Shape.shapeOf(shapeInfo);
        return (rank == 2 && shape.getInt(0) == 1) || rank == 1;

    }
276317
public function setLineColor($r, $g, $b)
    {

        $this->ink['line'] = imagecolorallocate($this->im, $r, $g, $b);
    }
1021911
public static final String toBrowserRGBA(final int r, final int g, final int b, final double a)
    {
        return "rgba(" + fixRGB(r) + "," + fixRGB(g) + "," + fixRGB(g) + "," + fixAlpha(a) + ")";
    }
902013
protected IConceptSet getA(int B, int r) {
        if (B >= CONCEPTS) {
            resizeConcepts(B);
        }
        if (r >= ROLES) {
            resizeRoles(r);
        }
        // Note the "+1" in the following line:
        final int index = indexOf(B, r) + 1;
        if (null == data[index]) {
            data[index] = new SparseConceptSet();
            addRole(r);

            if (null != base && index < base.length && null != base[index]) {
                data[index].addAll(base[index]);
            }
        }
        return data[index];
    }
155802
protected Icon getIcon(AbstractButton b) {
        Icon        icon  = b.getIcon();
        ButtonModel model = b.getModel();

        if (!model.isEnabled()) {
            icon = getSynthDisabledIcon(b, icon);
        } else if (model.isPressed() && model.isArmed()) {
            icon = getPressedIcon(b, getSelectedIcon(b, icon));
        } else if (b.isRolloverEnabled() && model.isRollover()) {
            icon = getRolloverIcon(b, getSelectedIcon(b, icon));
        } else if (model.isSelected()) {
            icon = getSelectedIcon(b, icon);
        } else {
            icon = getEnabledIcon(b, icon);
        }

        if (icon == null) {
            return getDefaultIcon(b);
        }

        return icon;
    }
224403
static ShapeDrawable getRoundedOutlineBackground(Resources resources, @ColorInt int color) {
        int r = resources.getDimensionPixelSize(R.dimen.com_auth0_lock_widget_corner_radius);
        int t = resources.getDimensionPixelSize(R.dimen.com_auth0_lock_input_field_stroke_width);
        RoundRectShape rr = new RoundRectShape(new float[]{r, r, r, r, r, r, r, r}, new RectF(t, t, t, t), new float[]{r, r, r, r, r, r, r, r});
        ShapeDrawable drawable = new ShapeDrawable(rr);
        drawable.getPaint().setColor(color);
        return drawable;
    }
272196
public static RGBColor rgb(int r, int g, int b) {
    return new RGBColor(makeRgb(r, g, b));
  }
349221
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius) {
        drawRoundedCorners(src, dest, radius, CLEAR_COLOR);
    }
1145937
@Override
    public DMatrixRMaj getR(DMatrixRMaj R, boolean compact) {
        if( R == null ) {
            if( compact ) {
                R = new DMatrixRMaj(minLength,numCols);
            } else
                R = new DMatrixRMaj(numRows,numCols);
        } else {
            if( compact ) {
                R.reshape(minLength,numCols);
            } else {
                R.reshape(numRows,numCols);
            }

            for( int i = 0; i < R.numRows; i++ ) {
                int min = Math.min(i,R.numCols);
                for( int j = 0; j < min; j++ ) {
                    R.set(i,j,0);
                }
            }
        }

        for( int i = 0; i < minLength; i++ ) {
            for( int j = i; j < numCols; j++ ) {
                double val = QR.get(i,j);
                R.set(i,j,val);
            }
        }

        return R;
    }
1009333
protected Rectangle2D getTextBounds(String text, Graphics2D g2) {
        return new TextLayout(text, g2.getFont(), g2.getFontRenderContext()).getBounds();
    }
818912
public void set( DMatrixD1 b )
    {
        this.reshape(b.numRows,b.numCols);

        int dataLength = b.getNumElements();

        System.arraycopy(b.data, 0, this.data, 0, dataLength);
    }
1223821
public void setRowMargin(int l, int t, int r, int b) {
        mRowMargin[0] = l; mRowMargin[1] = t; mRowMargin[2] = r; mRowMargin[3] = b;
    }
199165
public function setAxisColor($r, $g, $b)
    {
        $this->ink['axis'] = imagecolorallocate($this->im, $r, $g, $b);
    }
1360028
protected Rectangle getRadialMenuBounds (SceneObject scobj)
    {
        Rectangle mbounds = new Rectangle(scobj.bounds);
        Dimension radbox = getObjectRadialSize();
        if (mbounds.width != radbox.width) {
            mbounds.x += (mbounds.width-radbox.width)/2;
            mbounds.width = radbox.width;
        }
        if (mbounds.height != radbox.height) {
            mbounds.y += (mbounds.height-radbox.height)/2;
            mbounds.height = radbox.height;
        }
        return mbounds;
    }
673649
private RectF getMatrixRectF() {
		Matrix matrix = scaleMatrix;
		RectF rect = new RectF();
		Drawable d = getDrawable();
		if (null != d) {
			rect.set(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
			matrix.mapRect(rect);
		}
		return rect;
	}
453726
protected Icon getDefaultIcon(AbstractButton b) {
        SeaGlassContext context = getContext(b);
        Icon            icon    = context.getStyle().getIcon(context, getPropertyPrefix() + "icon");

        context.dispose();
        return icon;
    }