本文整理汇总了Java中org.netbeans.lib.awtextra.AbsoluteConstraints类的典型用法代码示例。如果您正苦于以下问题:Java AbsoluteConstraints类的具体用法?Java AbsoluteConstraints怎么用?Java AbsoluteConstraints使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbsoluteConstraints类属于org.netbeans.lib.awtextra包,在下文中一共展示了AbsoluteConstraints类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: vidaAtual
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de cura ou dano
*
* @param value valor da cura ou do dano (positivo para cura, negativo para
* dano)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
* @param enviar send o pacote de animação pela rede {@code true} ou
* {@code false}
*/
public void vidaAtual(int value, long time, boolean sleep, boolean enviar) {
if (this.sleep = sleep && card.getDono().getMesa().contains(card)) {
Audios.playEfeitos(value > 0 ? Audios.PARTIDA_CURAR : Audios.PARTIDA_DANO_GERADO);
}
clear();
Color color = value > 0 ? Color.GREEN : Color.RED;
String string = ((value > 0 ? "+" : "") + value);
TextoComBorda t = TextoComBorda.create(string, 40, color, toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x - 5, y - 30, t.getWidth(), t.getHeight()));
text.setVisible(true);
if (value <= 0) {
icon.setIcon(Images.ICON_DANO_LACAIO);
icon.setVisible(true);
}
if (enviar) {
enviarPacote(Param.ANIMACAO_CARD_VIDA_ATUAL, value);
}
show(time);
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:32,代码来源:Animacao.java
示例2: vidaMaxima
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de vidaAtual alterada
*
* @param value quantidade de vidaAtual alterada (positivo ou negativo)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
*/
public void vidaMaxima(int value, long time, boolean sleep) {
this.sleep = sleep;
if (value != 0) {
clear();
Color color = value > 0 ? Color.GREEN : Color.RED;
String string = ((value > 0 ? "+" : "") + value);
TextoComBorda t = TextoComBorda.create(string, 40, color, toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x - 5, y - 25, t.getWidth(), t.getHeight()));
text.setVisible(true);
icon.setIcon(Images.ICON_HEALTH);
icon.setVisible(true);
enviarPacote(Param.ANIMACAO_CARD_VIDA_MAXIMA, value);
show(time);
}
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:25,代码来源:Animacao.java
示例3: ataque
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de ataque alterado
*
* @param value quantidade de ataque alterado (positivo ou negativo)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
*/
public void ataque(int value, long time, boolean sleep) {
this.sleep = sleep;
if (value != 0) {
clear();
Color color = value > 0 ? Color.GREEN : Color.RED;
String string = ((value > 0 ? "+" : "") + value);
TextoComBorda t = TextoComBorda.create(string, 40, color, toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x, y - 24, t.getWidth(), t.getHeight()));
text.setVisible(true);
icon.setIcon(Images.ICON_ATAQUE);
icon.setVisible(true);
enviarPacote(Param.ANIMACAO_CARD_ATAQUE, value);
show(time);
}
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:25,代码来源:Animacao.java
示例4: vidaOriginal
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de vidaAtual original alterada
*
* @param value novo valor de vidaAtual
* @param time tempo de exibição da animação em milissegundos
*/
public void vidaOriginal(int value, long time) {
this.sleep = true;
if (value > 0) {
clear();
TextoComBorda t = TextoComBorda.create(Integer.toString(value), 40, Color.GRAY.brighter(), toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x - 5, y - 25, t.getWidth(), t.getHeight()));
text.setVisible(true);
icon.setIcon(Images.ICON_HEALTH);
icon.setVisible(true);
enviarPacote(Param.ANIMACAO_CARD_VIDA_ORIGINAL, value);
show(time);
}
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:22,代码来源:Animacao.java
示例5: vida
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de cura ou dano
*
* @param value valor da cura ou do dano (positivo para cura, negativo para
* dano)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
*/
public void vida(int value, long time, boolean sleep) {
this.sleep = sleep;
clear();
Color color = value > 0 ? Color.GREEN : Color.RED;
String string = ((value > 0 ? "+" : "") + value);
TextoComBorda t = TextoComBorda.create(string, 40, color, toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x - 5, y - 30, t.getWidth(), t.getHeight()));
text.setVisible(true);
if (value <= 0) {
icon.setIcon(Images.ICON_DANO_HEROI);
icon.setVisible(true);
}
enviarPacote(VIDA, value);
Audios.playEfeitos(value > 0 ? Audios.PARTIDA_CURAR : Audios.PARTIDA_DANO_GERADO);
show(time);
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:27,代码来源:Animacao.java
示例6: escudo
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de escudo alterado
*
* @param value valor alterado do escudo (positivo ou negativo)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
*/
public void escudo(int value, long time, boolean sleep) {
this.sleep = sleep;
if (value > 0) {
clear();
TextoComBorda t = TextoComBorda.create("+" + value, 40, Color.GRAY.brighter(), toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x - 5, y - 30, t.getWidth(), t.getHeight()));
text.setVisible(true);
icon.setIcon(Images.HEROI_ESCUDO);
icon.setVisible(true);
enviarPacote(ESCUDO, value);
show(time);
}
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:23,代码来源:Animacao.java
示例7: ataque
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Animação de ataque alterado
*
* @param value valor alterado do ataque (positivo ou negativo)
* @param time tempo de exibição da animação em milissegundos
* @param sleep ativar Thread.sleep {@code true} ou {@code false}
*/
public void ataque(int value, long time, boolean sleep) {
this.sleep = sleep;
if (value != 0) {
clear();
TextoComBorda t = TextoComBorda.create("+" + value, 36, Color.GRAY.brighter(), toString());
int x = text.getWidth() / 2 - t.getWidth() / 2;
int y = text.getHeight() / 2;
text.add(t, new AbsoluteConstraints(x, y - 22, t.getWidth(), t.getHeight()));
text.setVisible(true);
icon.setIcon(Images.ICON_ATAQUE);
icon.setVisible(true);
enviarPacote(ATAQUE, value);
show(time);
}
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:23,代码来源:Animacao.java
示例8: atualizar
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
public void atualizar() {
int qtd = heroi.getDeck().size();
double total = cardBack.getIconHeight() * qtd;
double diferenca;
if (total > (150 - cardBack.getIconHeight())) {
diferenca = (total - (150 - cardBack.getIconHeight())) / qtd;
} else {
diferenca = 0;
}
double x = cardBack.getIconHeight() - diferenca;
removeAll();
for (double index = 0; index < qtd; index++) {
add(new JLabel(cardBack), new AbsoluteConstraints(0, (int) (x * index)));
}
revalidate();
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:17,代码来源:DeckBack.java
示例9: atualizar
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
public void atualizar() {
int qtd = heroi.getMao().size();
int total = 123 * qtd;
int diferenca;
if (total > (500 - 123)) {
diferenca = (total - (500 - 123)) / qtd;
} else {
diferenca = 0;
}
int x = 123 - diferenca;
removeAll();
for (int j = 0; j < qtd; j++) {
JLabel card = new JLabel(heroi.getCardback().getImageIcon(DimensionValues.CARD_SMALL));
card.setPreferredSize(new Dimension(card.getPreferredSize().width - 9, card.getPreferredSize().height));
card.setHorizontalAlignment(SwingConstants.CENTER);
add(card, new AbsoluteConstraints(x * j, 0));
}
revalidate();
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:20,代码来源:MaoBack.java
示例10: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void init() {
panel.setOpaque(false);
popUp = new PopUp();
areaClicavel = new JLabel() {
@Override
public String toString() {
return Values.TO_STRING_PODER_HEROICO + poder.getHeroi();
}
};
custo = new Custo(poder);
imagem = new JLabel();
model = new Model();
panel.add(areaClicavel, AbsolutesConstraints.PODER_HEROICO_AREA_CLICAVEL);
panel.add(custo, new AbsoluteConstraints(42, 61, 36, 40));
panel.add(model, AbsolutesConstraints.ZERO);
panel.add(imagem, new AbsoluteConstraints(25, 85, 87, 88));
setAtivado(false);
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:19,代码来源:View.java
示例11: preencherPagina
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Exibe os cards na página
*/
private void preencherPagina() {
jButtonLeft.setEnabled(pagina != 1);
jButtonLeft.setVisible(pagina != 1);
jButtonRight.setEnabled(pagina * 8 < collection.size());
jButtonRight.setVisible(pagina * 8 < collection.size());
int ini = (pagina - 1) * 8;
int end = pagina * 8;
for (int i = ini; i < end; i++) {
collectionPanel[i % 8].removeAll();
collectionPanel[i % 8].add((i < collection.size()
? new JLabel(Images.getCardIcon(Images.CARD_MEDIUM, collection.get(i).getId()))
: new JLabel()), new AbsoluteConstraints(0, 0));
if (i < collection.size()) {
collectionPanel[i % 8].setName(collection.get(i).getId());
}
}
repaint();
revalidate();
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:23,代码来源:Colecao.java
示例12: initComponents
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
btn_save = new javax.swing.JButton();
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
btn_save.setText("Save");
btn_save.setEnabled(false);
btn_save.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_saveActionPerformed(evt);
}
});
getContentPane().add(btn_save, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));
pack();
}
开发者ID:russfeld,项目名称:rubiksolver,代码行数:25,代码来源:ViewCube2.java
示例13: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void init() {
setLayout(new AbsoluteLayout());
dateText.setText("");
dateText.setEditable(false);
dateText.setBackground(new Color(255, 255, 255));
add(dateText, new AbsoluteConstraints(0, 0, 120, 20));
dateDropdownButton.setText("...");
dateDropdownButton.setMargin(new Insets(2, 2, 2, 2));
dateDropdownButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
onButtonClick(actionevent);
}
});
add(dateDropdownButton, new AbsoluteConstraints(125, 0, 20, 21));
dateText.setText("");
dateText.setEditable(false);
dateText.setBackground(new Color(255, 255, 255));
}
开发者ID:Torridity,项目名称:dsworkbench,代码行数:21,代码来源:DateField.java
示例14: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void init() {
setLayout(new AbsoluteLayout());
timeText.setText("");
timeText.setEditable(false);
timeText.setBackground(new Color(255, 255, 255));
add(timeText, new AbsoluteConstraints(0, 0, 120, 20));
timeDropdownButton.setText("...");
timeDropdownButton.setMargin(new Insets(2, 2, 2, 2));
timeDropdownButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
onButtonClick(actionevent);
}
});
add(timeDropdownButton, new AbsoluteConstraints(125, 0, 20, 21));
timeText.setText("");
timeText.setEditable(false);
timeText.setBackground(new Color(255, 255, 255));
}
开发者ID:Torridity,项目名称:dsworkbench,代码行数:21,代码来源:TimeField.java
示例15: showPanel
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void showPanel(){
origin = new Point((compSize.width * 10)/100, (compSize.height * 20)/100);
hgap = 0;
vgap = ((compSize.height * 60)/100) - 40;
labelSize = new Dimension((compSize.width * 80 * 40)/10000, 20);
comboSize = new Dimension((compSize.width * 80 * 60)/10000, 20);
LocationGenerator locGen = new LocationGenerator(origin, labelSize.width + hgap,labelSize.height + vgap);
JLabel lRasiStr = new JLabel(DisplayStrings.RASI_STR.toString(Language.ENGLISH));
JLabel lNakStr = new JLabel(DisplayStrings.NAK_STR.toString(Language.ENGLISH));
//lRasiStr.setFont(font);
//lNakStr.setFont(font);
add(lRasiStr, new AbsoluteConstraints(locGen.getNextRow(), labelSize));
add(rasiCombo, new AbsoluteConstraints(locGen.getNextColumn(), comboSize));
add(lNakStr, new AbsoluteConstraints(locGen.getNextRow(), labelSize));
add(nakCombo, new AbsoluteConstraints(locGen.getNextColumn(),comboSize));
if (title != null){
setBorder(UIConsts.getTitleBorder(title));
}
setVisible(true);
}
开发者ID:erajasekar,项目名称:Astrosoft,代码行数:25,代码来源:RasiNakshathraChooser.java
示例16: getConstraintsConstructor
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private static Constructor getConstraintsConstructor() {
if (constrConstructor == null) {
try {
constrConstructor = AbsoluteConstraints.class.getConstructor(
new Class[] { Integer.TYPE, Integer.TYPE,
Integer.TYPE, Integer.TYPE });
}
catch (NoSuchMethodException ex) { // should not happen
ex.printStackTrace();
}
}
return constrConstructor;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:AbsoluteLayoutSupport.java
示例17: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
/**
* Configurar os componentes da janela
*/
public final void init() {
setLayout(new AbsoluteLayout());
setUndecorated(true);
setBackground(new Color(0, 0, 0, 0));
add(new JLabel(imagem), new AbsoluteConstraints(0, 0));
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
dispose();
}
});
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:17,代码来源:PopUp.java
示例18: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void init() {
setOpaque(false);
quantidade = new Quantidade(heroi);
background = new JLabel(Images.HEROI_SEGREDO) {
@Override
public String toString() {
return Values.TO_STRING_SEGREDO + heroi.getHeroi();
}
};
add(quantidade, new AbsoluteConstraints(0, -7, 60, 60));
add(background, new AbsoluteConstraints(0, 0, 60, 60));
setVisible(false);
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:15,代码来源:Segredo.java
示例19: init
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
private void init(){
setOpaque(false);
shield = new JLabelAtributos(heroi, JLabelAtributos.SHIELD);
background = new JLabel(Images.HEROI_ESCUDO, SwingConstants.CENTER);
add(shield, AbsolutesConstraints.HEROI_LABEL_ESCUDO);
add(background, new AbsoluteConstraints(0, 0, 70, 70));
setVisible(heroi.getShield() > 0);
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:10,代码来源:Escudo.java
示例20: atualizar
import org.netbeans.lib.awtextra.AbsoluteConstraints; //导入依赖的package包/类
public void atualizar() {
removeAll();
for (int index = heroi.getMao().size() - 1; index >= 0; index--) {
int total = 123 * heroi.getMao().size();
int diferenca;
if (total > (500 - 123)) {
diferenca = (total - (500 - 123)) / heroi.getMao().size();
} else {
diferenca = 0;
}
int x = 123 - diferenca;
add(heroi.getMao().get(index).viewCardMao, new AbsoluteConstraints(x * index, 0));
}
revalidate();
}
开发者ID:limagiran,项目名称:hearthstone,代码行数:16,代码来源:Mao.java
注:本文中的org.netbeans.lib.awtextra.AbsoluteConstraints类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论