indexlocation.java

来自「这是我自己写的一个小的JAVA实现的俄罗斯方块」· Java 代码 · 共 99 行

JAVA
99
字号
package net.rectang;public class IndexLocation {	private Index indexOne = null;	private Index indexTwo = null;	private Index indexThree = null;	private Index indexFour = null;		public IndexLocation() {	}		public IndexLocation(Index indexOne, Index indexTwo, Index indexThree,			Index indexFour) {		super();		this.indexOne = indexOne;		this.indexTwo = indexTwo;		this.indexThree = indexThree;		this.indexFour = indexFour;	}	public Index getIndexOne() {		return indexOne;	}	public void setIndexOne(Index indexOne) {		this.indexOne = indexOne;	}	public Index getIndexTwo() {		return indexTwo;	}	public void setIndexTwo(Index indexTwo) {		this.indexTwo = indexTwo;	}	public Index getIndexThree() {		return indexThree;	}	public void setIndexThree(Index indexThree) {		this.indexThree = indexThree;	}	public Index getIndexFour() {		return indexFour;	}	public void setIndexFour(Index indexFour) {		this.indexFour = indexFour;	}	public int getMaxWidth(){		int maxWidth = indexOne.getLocationX();		if(indexTwo.getLocationX() > maxWidth){			maxWidth = indexTwo.getLocationX();		}		if(indexThree.getLocationX() > maxWidth){			maxWidth = indexThree.getLocationX();		}		if(indexFour.getLocationX() > maxWidth){			maxWidth = indexFour.getLocationX();		}		return maxWidth;	}	public int getMaxHeight(){		int maxHeight = indexOne.getLocationY();		if(indexTwo.getLocationY() > maxHeight){			maxHeight  = indexTwo.getLocationY();		}		if(indexThree.getLocationY() > maxHeight){			maxHeight  = indexThree.getLocationY();		}		if(indexFour.getLocationY() > maxHeight){			maxHeight  = indexFour.getLocationY();		}		return maxHeight ;	}	public int getMinWidth(){		int minWidth = indexOne.getLocationX();		if(indexTwo.getLocationX() < minWidth){			minWidth = indexTwo.getLocationX();		}		if(indexThree.getLocationX() < minWidth){			minWidth = indexThree.getLocationX();		}		if(indexFour.getLocationX() < minWidth){			minWidth = indexFour.getLocationX();		}		return minWidth;	}	public int getMinHeight(){		int minHeight = indexOne.getLocationY();		if(indexTwo.getLocationY() < minHeight){			minHeight = indexTwo.getLocationY();		}		if(indexThree.getLocationY() < minHeight){			minHeight = indexThree.getLocationY();		}		if(indexFour.getLocationY() < minHeight){			minHeight = indexFour.getLocationY();		}		return minHeight;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?