当前位置: 首页 > news >正文

广州网站推广找哪家网站建设技术列表

广州网站推广找哪家,网站建设技术列表,网页设计实训报告技术难点,湖南网站网络推广哪家奿本文整理匯總了Java中java.awt.Point.setLocation方法的典型用法代碼示例。如果您正苦於以下問題#xff1a;Java Point.setLocation方法的具體用法#xff1f;Java Point.setLocation怎麽用#xff1f;Java Point.setLocation使用的例子#xff1f;那麽恭喜您, 這裏精選的…本文整理匯總了Java中java.awt.Point.setLocation方法的典型用法代碼示例。如果您正苦於以下問題Java Point.setLocation方法的具體用法Java Point.setLocation怎麽用Java Point.setLocation使用的例子那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Point的用法示例。在下文中一共展示了Point.setLocation方法的20個代碼示例這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚您的評價將有助於我們的係統推薦出更棒的Java代碼示例。示例1: computeTextLocation​點讚 3​import java.awt.Point; //導入方法依賴的package包/類/*** Compute the position where a box with text shall be displayed, in such* way that it will not go out of the image.** param box the initial position of the box* param labelSize the size of the text box* param bounds the bounds where the text should fit* return the position where the box shall be drawn, in order to avoid getting out of the bounds.*/public static Point computeTextLocation(Rectangle box, Dimension labelSize, Dimension bounds) {Point pos new Point(box.x, box.y - labelSize.height - 1);if (pos.x 0) {pos.setLocation(0, pos.y);}if (pos.y 0) {pos.setLocation(pos.x, 0);}if ((box.x labelSize.width) bounds.width) {pos.setLocation(bounds.width - labelSize.width - 1, pos.y);}if ((box.y labelSize.height) bounds.height) {pos.setLocation(pos.x, bounds.height - labelSize.height - 1);}return pos;}開發者ID:buni-rock項目名稱:Pixie代碼行數:31示例2: Roundabout​點讚 3​import java.awt.Point; //導入方法依賴的package包/類/*** Constructs a roundabout to prevent collision of two drones. Creates a circle with 32 points on it.* Drones travel clockwise and enter and exit at points only.* param drone Drone 1* param drone2 Drone 2*/public Roundabout(ManagedDrone drone, ManagedDrone drone2){ //Coordinates D1, Coordinates D2){drone1Coords drone.getCoordinates();drone2Coords drone2.getCoordinates();//System.out.println(drone1Coords.toString() drone2Coords.toString());hub new Coordinates(0,0,0);radius 2000;circumferenceCoordinates new Coordinates[32];constructRoundabout();Point pnt new Point();pnt.setLocation(hub.getLatitude(),hub.getLongitude());computeCirclePoints(32,radius,pnt);computeDroneEntryExitPoints(drone);computeDroneEntryExitPoints(drone2);System.out.println(Roundabout built);}開發者ID:JaneClelandHuang項目名稱:Dronology代碼行數:22示例3: dropFood​點讚 3​import java.awt.Point; //導入方法依賴的package包/類public void dropFood(final int turn) {if (turn % FOOD_REFILL_FREQUENCY 0) {int row;int column;final Point position new Point(0, 0);do {row RANDOMIZER.nextInt(X_BOUNDRY / 2);if (turn % (FOOD_REFILL_FREQUENCY * 2) 0) {row X_BOUNDRY / 2;}column RANDOMIZER.nextInt(Y_BOUNDRY - 1);position.setLocation(row, column);System.out.println(Generated food x-position : row);} while (this.world.isPositionOccupied(position) || this.world.isHillPosition(position));final Food newFood new Food(this.world.idSequence, 1, position);try {this.world.placeObject(newFood);} catch (final InvalidWorldPositionException e) {System.out.println(Position had not space, food was not dropped. Position was: newFood.getPosition());}}}開發者ID:gamefest2017項目名稱:ants代碼行數:26示例4: print​點讚 3​import java.awt.Point; //導入方法依賴的package包/類/*** Prints an image on a component.** param component* The component.** param columnIndex* The x-axis (column) coordinate of the top-left character.** param rowIndex* The y-axis (row) coordinate of the top-left character.** throws NullPointerException* If the screen is null.*/private void print(final NonNull Component component, final int columnIndex, final int rowIndex) {final BufferedImage temp applyTransformations();final Point charPosition new Point(0, 0);for (int y 0 ; y temp.getHeight() y component.getHeight() ; y) {for (int x 0 ; x temp.getWidth() x component.getWidth() ; x) {final int hexColor temp.getRGB(x,y);final int red (hexColor 0x00ff0000) 16;final int green (hexColor 0x0000ff00) 8;final int blue hexColor 0x000000ff;final int charX x columnIndex;final int charY y rowIndex;charPosition.setLocation(charX, charY);final AsciiCharacter character component.getCharacterAt(charPosition);character.setCharacter(printChar);character.setForegroundColor(new Color(red, green, blue));}}}開發者ID:Valkryst項目名稱:VTerminal代碼行數:37示例5: originalToResized​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Computes the corespondent position in the resized image, of the given* pixel from the original image.** param origPoint - the (x,y) coordinate of the pixel from the original image* return - returns a Point object with two elements: x and y coordinates of the point in the resized image (in this order)*/public Point originalToResized(Point origPoint) {if ((origPoint null) || (Double.compare(ratioWidth, 0.0) 0) || (Double.compare(ratioHeight, 0.0) 0)) {return null;}Point resizedPoint new Point();resizedPoint.setLocation((int) (origPoint.getX() / ratioWidth), (int) (origPoint.getY() / ratioHeight));return resizedPoint;}開發者ID:buni-rock項目名稱:Pixie代碼行數:17示例6: finish​點讚 2​import java.awt.Point; //導入方法依賴的package包/類private void finish() {for (GraphNode n : scene.getNodes()) {NodeWidget w getWidget(n);Widget wid scene.findWidget(n);Point point new Point();point.setLocation(w.locX, w.locY);if (scene.isAnimated()) {scene.getSceneAnimator().animatePreferredLocation(wid, point);} else {wid.setPreferredLocation(point);}}}開發者ID:apache項目名稱:incubator-netbeans代碼行數:14示例7: layoutCirculary​點讚 2​import java.awt.Point; //導入方法依賴的package包/類private void layoutCirculary(Collection nodes, GraphNode masterNode) {Point masterPoint new Point();NodeWidget master getWidget(masterNode);masterPoint.setLocation(master.locX, master.locY);double r;double theta;double thetaStep Math.PI / 5;r 150;theta 0;Iterator it nodes.iterator();NodeWidget nw getWidget(it.next());while (true) {AffineTransform tr AffineTransform.getRotateInstance(theta);Point2D d2point tr.transform(new Point2D.Double(0, r), null);Point point new Point((int)d2point.getX() masterPoint.x, (int)d2point.getY() masterPoint.y);if (isThereFreeSpace(point, nw)) {nw.locX point.getX();nw.locY point.getY();nw.dispX 0;nw.dispY 0;if (it.hasNext()) {nw getWidget(it.next());} else {return;}}theta theta thetaStep;if (theta (Math.PI * 2 - Math.PI / 10)) {r r 90;theta theta - Math.PI * 2;thetaStep thetaStep * 3 / 4;}}}開發者ID:apache項目名稱:incubator-netbeans代碼行數:36示例8: relayoutNonFixed​點讚 2​import java.awt.Point; //導入方法依賴的package包/類private void relayoutNonFixed(NodeWidget w) {Point masterPoint new Point();masterPoint.setLocation(w.locX, w.locY);double r;double theta;double thetaStep Math.PI / 5;r 30;theta 0;w.setFixed(false);while (true) {AffineTransform tr AffineTransform.getRotateInstance(theta);Point2D d2point tr.transform(new Point2D.Double(0, r), null);Point point new Point((int)d2point.getX() masterPoint.x, (int)d2point.getY() masterPoint.y);w.locX point.getX();w.locY point.getY();if (isThereFreeSpaceNonFixedSpace(w)) {w.setFixed(true);return;}theta theta thetaStep;if (theta (Math.PI * 2 - Math.PI / 10)) {r r 30;theta theta - Math.PI * 2;thetaStep thetaStep * 3 / 4;}}}開發者ID:apache項目名稱:incubator-netbeans代碼行數:29示例9: actionPerformed​點讚 2​import java.awt.Point; //導入方法依賴的package包/類public void actionPerformed(ActionEvent e){Point v_Point this.button.getLocationOnScreen();v_Point.setLocation(v_Point.getX() ,v_Point.getY() this.button.getHeight());this.jdt.setLocation(v_Point);this.jdt.setVisible(!this.jdt.isVisible());}開發者ID:HY-ZhengWei項目名稱:hy.common.ui代碼行數:10示例10: setLocationForTable​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Sets the location to a point the table.** param table* param location*/private void setLocationForTable(JTable table, Point location) {if (location ! null) {Rectangle cellRect table.getCellRect(table.getEditingRow(), table.getEditingColumn(), false);location.setLocation(cellRect.getLocation());}}開發者ID:jalian-systems項目名稱:marathonv5代碼行數:13示例11: getPopOverPosition​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Returns the position of the upper left corner of the popover winndow** param pos* return*/public static Point getPopOverPosition() {ConfigIO cfg ConfigIO.getInstance();String screenId cfg.getScreenId();ScreenModel screenModel getScreen(screenId);int screenWidth screenModel.getWidth();int screenHeight screenModel.getHeight();Point point screenModel.getTopLeftCorner();int scrPosId cfg.getScreenPositionId();ScreenPosition screenPos getScreenPosition(scrPosId);Pos pos screenPos.getPos();switch (pos) {case TOP_LEFT:point.setLocation(point.x PADDING, point.y 0 ARROW_SIZE);break;case TOP_RIGHT:point.setLocation(point.x screenWidth PADDING / 2, point.y 0 ARROW_SIZE);break;case BOTTOM_LEFT:point.setLocation(point.x PADDING, point.y screenHeight DropzonePopOver.HEIGHT - ARROW_SIZE * 2);break;case BOTTOM_RIGHT:point.setLocation(point.x screenWidth PADDING / 2,point.y screenHeight DropzonePopOver.HEIGHT - ARROW_SIZE * 2);break;}return point;}開發者ID:michaelnetter項目名稱:dracoon-dropzone代碼行數:41示例12: move​點讚 2​import java.awt.Point; //導入方法依賴的package包/類public IAnt move(final IAnt ant, final Direction direction) throws MoveException {final double newXPos ant.getPosition().getX() direction.getPositionChange().getX();final double newYPos ant.getPosition().getY() direction.getPositionChange().getY();final Point destination new Point((int) newXPos, (int) newYPos);if (this.world.isPositionOccupiedByBorder(destination)) {throw new MoveException(Cant go to border of the world grid at position destination);}final Point position new Point();position.setLocation(newXPos, newYPos);if (ant instanceof AbstractAnt ant.getMyHill().getPosition().equals(position)) {moveHome(ant.getMyHill(), (AbstractAnt) ant);}final Object worldObject this.world.getWorldObject(position);if (worldObject null || ant.getMyHill().getPosition().equals(position)) {System.out.println(Im moving from [ ant.getPosition().x , ant.getPosition().y ] to direction.name() [ position.x , position.y ] , out of my way!);ant.setPosition(position);} else if (worldObject instanceof Food ant instanceof AbstractAnt) {final AbstractAnt worker (AbstractAnt) ant;final Food food (Food) worldObject;if (!worker.hasFood()) {worker.pickUpFood(food);this.world.removeObject(food);}worker.setPosition(position);} else if (worldObject instanceof IAnt ant instanceof AbstractWarrior ant.isEnemy((IAnt) worldObject)) {final AbstractWarrior warrior (AbstractWarrior) ant;moveToEnemyAndKill(warrior, (IAnt) worldObject);warrior.setPosition(position);} else {System.out.println(I will not move to direction.name() ! The place is occupied.);}return ant;}開發者ID:gamefest2017項目名稱:ants代碼行數:39示例13: getComponentCenterLocation​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Get the component center location {link Point}** param component the target component* return center location {link Point}*/private Point getComponentCenterLocation(Component component ) {Point centerPoint new Point();centerPoint.setLocation(component.getX() component.getWidth() / 2,component.getY() component.getHeight() / 2);return centerPoint;}開發者ID:Axway項目名稱:ats-framework代碼行數:15示例14: findClosestTwoIndices​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Finds the nearest two track points to a Point2D double point. This method* uses the fast local minimum search to find the nearest point, then checks* in each direction for the next nearest point.** param p the Point2D in x,y space.* return a Point with the two nearest track points as x (nearest) and y* (next nearest).*/public Point findClosestTwoIndices(Point2D p) {Point idxP new Point(-1, -1);if (trackPoints null) {return idxP;}int idx1 findClosestIndex(p, Float.MAX_VALUE, true); // truefast search, starting where last one ended.if (idx1 0) {// Find which one of the neighbors is closestint idx2 idx1 - 1;if (idx2 0) {idx2 getNumPoints() - 1;}int idx3 idx1 1;if (idx3 getNumPoints()) {idx3 0;}Point2D p2 getPoint(idx2);Point2D p3 getPoint(idx3);double dist2 p2.distance(p);double dist3 p3.distance(p);if (dist2 dist3) {idxP.setLocation(max(idx1, idx2), min(idx1, idx2));} else {idxP.setLocation(max(idx1, idx3), min(idx1, idx3));}}return idxP;}開發者ID:SensorsINI項目名稱:jaer代碼行數:44示例15: recursiveFill​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Recursively fills an area on the screen bounded by the set of input points.** param points* The border points.** param position* The x/y-axis (column/row) coordinates of the current point.** return* The list of filled points.*/public static List recursiveFill(final List points, final Point position) {boolean pointExists false;int x position.x;int y position.y;for (final Point point : points) {if (point.x x point.y y) {pointExists true;break;}}if (pointExists false) {points.add(new Point(x, y));position.setLocation(x 1, y);recursiveFill(points, position);position.setLocation(x - 1, y);recursiveFill(points, position);position.setLocation(x, y 1);recursiveFill(points, position);position.setLocation(x, y - 1);recursiveFill(points, position);}return points;}開發者ID:Valkryst項目名稱:VTerminal代碼行數:43示例16: print​點讚 2​import java.awt.Point; //導入方法依賴的package包/類/*** Prints a rectangle on a screen.** If the function is set to perform connections, then it will attempt to* connect the new rectangle with existing similar rectangles in the draw area.** param screen* The screen.** param position* The x/y-axis (column/row) coordinates of the top-left character.** throws NullPointerException* If the screen is null.*/public void print(final NonNull Screen screen, final Point position) {final int width dimensions.width;final int height dimensions.height;final int x position.x;final int y position.y;final int lastRow y height - 1;final int lastColumn x width - 1;final Point writePosition new Point(0, 0);// Draw Corners:screen.write(rectangleType.getTopLeft(), position);writePosition.setLocation(lastColumn, y);screen.write(rectangleType.getTopRight(), writePosition);writePosition.setLocation(x, lastRow);screen.write(rectangleType.getBottomLeft(), writePosition);writePosition.setLocation(lastColumn, lastRow);screen.write(rectangleType.getBottomRight(), writePosition);// Draw Left/Right Sides:for (int i 1 ; i height - 1 ; i) {writePosition.setLocation(x, y i);screen.write(rectangleType.getVertical(), writePosition);writePosition.setLocation(lastColumn, y i);screen.write(rectangleType.getVertical(), writePosition);}// Draw Top/Bottom Sides:for (int i 1 ; i width - 1 ; i) {writePosition.setLocation(x i, y);screen.write(rectangleType.getHorizontal(), writePosition);writePosition.setLocation(x i, lastRow);screen.write(rectangleType.getHorizontal(), writePosition);}// Draw title on Top Side:if (title ! null title.isEmpty() false) {// Draw Title Text:final char[] titleChars title.toCharArray();for (int i 2; i width - 2 i - 2 titleChars.length; i) {writePosition.setLocation(x i, y);screen.write(titleChars[i - 2], writePosition);}// Draw Title Borders:writePosition.setLocation(x 1, y);screen.write(rectangleType.getConnectorLeft(), writePosition);writePosition.setLocation(x titleChars.length 2, y);screen.write(rectangleType.getConnectorRight(), writePosition);}// Handle Connectors:setConnectors(screen, position);}開發者ID:Valkryst項目名稱:VTerminal代碼行數:78示例17: nextPosition​點讚 2​import java.awt.Point; //導入方法依賴的package包/類protected void nextPosition(Point currentPos, Rectangle currentBounds, Point nextPos, Rectangle nextBounds, int dx, int dy) {int x currentPos.x currentBounds.width dx;int y currentPos.y;nextBounds.setLocation(x, y);nextPos.setLocation(x, y);}開發者ID:ajmath項目名稱:VASSAL-src代碼行數:7示例18: hasValidLeftNeighbour​點讚 1​import java.awt.Point; //導入方法依賴的package包/類/*** Determines if the left-neighbour of a cell is both of the correct* RectangleType and that the character of the left-neighbour can be* connected to.** param position* The x/y-axis (column/row) coordinates of the cell.** return* If the left-neighbour is valid.** throws NullPointerException* If the screen is null.*/private boolean hasValidLeftNeighbour(final NonNull Screen screen, final Point position) {try {position.setLocation(position.x - 1, position.y);return rectangleType.isValidLeftCharacter(screen.getCharacterAt(position));} catch (final IllegalArgumentException e) {return false;}}開發者ID:Valkryst項目名稱:VTerminal代碼行數:23示例19: printFilled​點讚 1​import java.awt.Point; //導入方法依賴的package包/類/*** Prints a rectangle on a screen.** If the function is set to perform connections, then it will attempt to* connect the new rectangle with existing similar rectangles in the draw area.** param screen* The screen.** param position* The x/y-axis (column/row) coordinates of the top-left character.** throws NullPointerException* If the screen is null.*/public void printFilled(final NonNull Screen screen, final Point position) {print(screen, position);final Dimension dimension new Dimension(this.dimensions.width - 2, this.dimensions.height - 2);position.setLocation(position.x 1, position.y 1);for (final Point point : ShapeAlgorithms.getFilledRectangle(position, dimension)) {screen.write(fillChar, point);}}開發者ID:Valkryst項目名稱:VTerminal代碼行數:26示例20: getFilledEllipse​點讚 1​import java.awt.Point; //導入方法依賴的package包/類/*** Constructs a list, containing the outline and fill, of an ellipses points.** param position* The x/y-axis (column/row) coordinates of the top-left character.** param dimension* The width/height.** return* The list of points.*/public static List getFilledEllipse(final Point position, final Dimension dimension) {final List points getEllipse(position, dimension);final int xCenter position.x (dimension.width / 2);final int yCenter position.y (dimension.height / 2);position.setLocation(xCenter, yCenter);return recursiveFill(points, position);}開發者ID:Valkryst項目名稱:VTerminal代碼行數:22注本文中的java.awt.Point.setLocation方法示例整理自Github/MSDocs等源碼及文檔管理平台相關代碼片段篩選自各路編程大神貢獻的開源項目源碼版權歸原作者所有傳播和使用請參考對應項目的License未經允許請勿轉載。
http://wiki.neutronadmin.com/news/268583/

相关文章:

  • 网站 建设appdjango 电商网站开发
  • 河池市住房和城乡建设局网站360平台怎么做网站优化
  • 福州科技网站建设怎么做改了网站关键词
  • flash 开发的网站河南省电力工程建设企业协会网站
  • 帝国做的网站怎么上传动漫设计就业前景
  • 佛山响应式网站建设公司html文件编辑器
  • 百度 网站描述营销网站制作皆选ls15227负责
  • 蜂蜜做的好网站或案例网站建设和网站
  • 做长直播的房地产网站曲靖公司网站建设
  • 公司做企业网站软件开发项目经理招聘
  • 网站开发微信端广州seo排名优化公司
  • 哪个网站可以做封面网页设计素材源文件
  • 凡科网做网站花多少钱网站开发技术学习
  • 如何制作手机免费网站模板下载机械建设网站制作
  • 公司域名更改 网站怎么做提示用wordpress制作表单
  • 网站备案 icp备案wordpress的虚拟主机
  • 黄埔网站建设网站建设放什么会计科目
  • 王稳庄网站建设中国建设银行网站的发展
  • 永久免费网站系统遵义网站建设哪家强
  • 做贸易的网站有哪些柒比贰wordpress主题
  • 郑州做网站kuihuakejidiscuz
  • 基于响应式设计的网站建设wordpress如何添加二级菜单
  • 给一个企业做网站苏州建设职业培训中心网站
  • 网站技术部门架构杭州网站建设优化案例
  • 网站关键词怎么改dz整站免费网站建设
  • 阿里巴巴网站谁做的 天堂最新版在线资源
  • 大型大型网站建设天津网站建设制作设计
  • 无锡企业建站网页qq空间
  • 一级做a爱网站免费wordpress 邮件 key
  • 正规的网站制作服务电话网站制作公司源码