本文整理了Java中java.awt.Rectangle.setFrame
方法的一些代码示例,展示了Rectangle.setFrame
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.setFrame
方法的具体详情如下:
包路径:java.awt.Rectangle
类名称:Rectangle
方法名:setFrame
暂无
代码示例来源:origin: org.jdesktop.bsaf/bsaf
@Override
public Object parseString(String s, ResourceMap ignore) throws ResourceConverterException {
List<Double> xywh = parseDoubles(s, 4, "invalid x,y,width,height Rectangle string");
Rectangle r = new Rectangle();
r.setFrame(xywh.get(0), xywh.get(1), xywh.get(2), xywh.get(3));
return r;
}
}
代码示例来源:origin: net.java.dev.appframework/appframework
@Override public Object parseString(String s, ResourceMap ignore) throws ResourceConverterException {
List<Double> xywh = parseDoubles(s, 4, "invalid x,y,width,height Rectangle string");
Rectangle r = new Rectangle();
r.setFrame(xywh.get(0), xywh.get(1), xywh.get(2), xywh.get(3));
return r;
}
}
代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod
/**
* Creates the root SVG node with the basic information.
*
* @param document
* @param w
* @param h
* @param inset
* @return a SVG node describing the SVG diagram
*/
protected Node createRoot(Document document, double w, double h, int inset) {
Element svg = (Element) document.createElement("svg");
svg.setAttribute("width", String.valueOf(w));
svg.setAttribute("height", String.valueOf(h));
svg.setAttribute("viewBox", "0 0 " + w + " " + h);
svg.setAttribute("allowZoomAndPan", "true");
svg.setAttribute("version", "1.1");
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
svg.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
viewBox.setFrame(inset, inset, w, h);
return svg;
}
代码示例来源:origin: qupath/qupath
public static Rectangle getBounds(final ImageRegion region, Rectangle rect) {
if (rect == null)
rect = new Rectangle();
rect.setFrame(region.getX(), region.getY(), region.getWidth(), region.getHeight());
return rect;
}
代码示例来源:origin: google/sagetv
newRectBounds.setFrame(rects[0]);
for (int i = 1; i < rects.length; i++)
newRectBounds.add(rects[i]);
代码示例来源:origin: andreiled/mipt-cs-4sem
private void updateViewBounds ()
{
final int maxWidth = getWidth () - 1, maxHeight = getHeight () - 1;
final FieldModel field = backend.getCurrentState ();
if (field.getWidth () / maxWidth < field.getHeight () / maxHeight)
{
int optWidth = (int) Math.round (field.getWidth () * maxHeight / field.getHeight ());
viewBounds.setFrame ((maxWidth - optWidth) / 2, 0, optWidth, maxHeight);
} else
{
int optHeight = (int) Math.round (field.getHeight () * maxWidth / field.getWidth ());
viewBounds.setFrame (0, (maxHeight - optHeight) / 2, maxWidth, optHeight);
}
}
代码示例来源:origin: com.l2fprod.common/l2fprod-common-shared
rect.setFrame(values[0], values[1], values[2], values[3]);
return rect;
} else if (Insets.class.equals(type)) {
代码示例来源:origin: net.sf.ingenias/ingeniasjgraphmod
(int) (pSize.height * scale));
g.setColor(Color.WHITE);
currentViewport.setFrame((int) (rect.getX() * scale),
(int) (rect.getY() * scale),
(int) (rect.getWidth() * scale), (int) (rect
代码示例来源:origin: google/sagetv
clipArea.setRect(0, 0, bufferWidth, bufferHeight);
Sage.clipSrcDestRects(op.destRect, videoSrc, videoDest);
srcVideoRect.setFrame(videoSrc);
srcVideoRect.x = Math.max(0, srcVideoRect.x);
srcVideoRect.y = Math.max(0, srcVideoRect.y);
srcVideoRect.width = Math.min(vw - srcVideoRect.x, srcVideoRect.width);
srcVideoRect.height = Math.min(vh - srcVideoRect.y, srcVideoRect.height);
usedVideoRect.setFrame(videoDest);
usedVideoRect.x = Math.max(0, usedVideoRect.x);
usedVideoRect.y = Math.max(0, usedVideoRect.y);
usedVideoRect.width = Math.min(bufferWidth - usedVideoRect.x, usedVideoRect.width);
usedVideoRect.height = Math.min(bufferHeight - usedVideoRect.y, usedVideoRect.height);
fullVideoRect.setFrame(op.destRect);
fullVideoRect.x = Math.max(0, fullVideoRect.x);
fullVideoRect.y = Math.max(0, fullVideoRect.y);
tempVideoRect.setFrame(op.destRect);
if (uiMgr.areLayersEnabled())
tempVideoRect.setFrame(fullVideoRect.x, fullVideoRect.y, usedVideoRect.x - fullVideoRect.x,
fullVideoRect.height);
fillShape0(null, null, cCache, -1, 4, tempVideoRect);
tempVideoRect.setFrame(fullVideoRect.x, fullVideoRect.y, fullVideoRect.width,
usedVideoRect.y - fullVideoRect.y);
fillShape0(null, null, cCache, -1, 4, tempVideoRect);
tempVideoRect.setFrame(fullVideoRect.x + fullVideoRect.width - adjust, fullVideoRect.y, adjust,
fullVideoRect.height);
代码示例来源:origin: google/sagetv
java.awt.Rectangle usedVideoRect = new java.awt.Rectangle();
java.awt.Rectangle fullVideoRect = new java.awt.Rectangle();
usedVideoRect.setFrame(videoDest);
fullVideoRect.setFrame(op.destRect);
代码示例来源:origin: google/sagetv
srcRect.setFrame(2, 2, op.copyImageRect.width, op.copyImageRect.height);
int surfMemSize = srcRect.width * srcRect.height * 4;
代码示例来源:origin: google/sagetv
java.awt.Rectangle usedVideoRect = new java.awt.Rectangle();
java.awt.Rectangle fullVideoRect = new java.awt.Rectangle();
usedVideoRect.setFrame(videoDest);
fullVideoRect.setFrame(op.destRect);
内容来源于网络,如有侵权,请联系作者删除!