没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
import java.io.*;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Vector;
class picture{
char[][] pic;
int h;
int w;
String name;
picture(int h,int w,TreeMap<String,picture> picTM,Vector<css> cssV){
this.h=h;
this.w=w;
pic = new char[h][w];
int[][] lay = new int[h][w];
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
lay[i][j]=0;
pic[i][j]='.';
}
}
for(int i=0;i<cssV.size();i++){
css c =cssV.elementAt(i);
picture p = picTM.get(c.getPicFile());
if(p!=null){
char[][] pc =p.getCharArray();
int startH=c.getTopLeftX(),startW=c.getTopLeftY(),H=p.getH(),W=p.getW(),layer=c.getLayer();
for(int j=startH;j-startH<H&&j<h;j++){
for(int k=startW;k-startW<W&&k<w;k++){
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Vector;
class picture{
char[][] pic;
int h;
int w;
String name;
picture(int h,int w,TreeMap<String,picture> picTM,Vector<css> cssV){
this.h=h;
this.w=w;
pic = new char[h][w];
int[][] lay = new int[h][w];
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
lay[i][j]=0;
pic[i][j]='.';
}
}
for(int i=0;i<cssV.size();i++){
css c =cssV.elementAt(i);
picture p = picTM.get(c.getPicFile());
if(p!=null){
char[][] pc =p.getCharArray();
int startH=c.getTopLeftX(),startW=c.getTopLeftY(),H=p.getH(),W=p.getW(),layer=c.getLayer();
for(int j=startH;j-startH<H&&j<h;j++){
for(int k=startW;k-startW<W&&k<w;k++){
char ch=pc[j-startH][k-startW];
if(j>=0&&k>=0){
if(ch!='.'){//||ch!=' '){
if(layer>=lay[j][k]){
pic[j][k]=ch;
lay[j][k]=layer;
}else{
if(pic[j][k]=='.'){//&&pic[j][k]==' '){
pic[j][k]=ch;
lay[j][k]=layer;
}
}
}
}
}
}
}
}
}
picture(String name,int h,int w,Scanner cin){// throws Exception{
//BufferedReader br = new BufferedReader(isr);
this.h=h;
this.w=w;
this.name=name;
pic = new char[h][w];
for(int i=0;i<h;i++){
pic[i]=cin.next().toCharArray();
}
}
public void display(){
if(j>=0&&k>=0){
if(ch!='.'){//||ch!=' '){
if(layer>=lay[j][k]){
pic[j][k]=ch;
lay[j][k]=layer;
}else{
if(pic[j][k]=='.'){//&&pic[j][k]==' '){
pic[j][k]=ch;
lay[j][k]=layer;
}
}
}
}
}
}
}
}
}
picture(String name,int h,int w,Scanner cin){// throws Exception{
//BufferedReader br = new BufferedReader(isr);
this.h=h;
this.w=w;
this.name=name;
pic = new char[h][w];
for(int i=0;i<h;i++){
pic[i]=cin.next().toCharArray();
}
}
public void display(){
剩余11页未读,继续阅读
资源评论
misloss
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功