use of org.orcid.jaxb.model.v3.dev1.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toEntity_withExistingEntityTest.
@Test
public void toEntity_withExistingEntityTest() {
Client client = getClient();
ClientDetailsEntity existingEntity = getClientDetailsEntity();
existingEntity = adapter.toEntity(client, existingEntity);
assertEquals(getClientDetailsEntity(), existingEntity);
}
use of org.orcid.jaxb.model.v3.dev1.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method getClientSummary.
private ClientSummary getClientSummary() {
ClientSummary summary = new ClientSummary();
summary.setDescription("description");
summary.setName("client-name");
return summary;
}
use of org.orcid.jaxb.model.v3.dev1.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toClientListTest.
@Test
public void toClientListTest() {
ClientDetailsEntity entity1 = getClientDetailsEntity();
List<ClientDetailsEntity> entities = new ArrayList<ClientDetailsEntity>();
entities.add(entity1);
Set<Client> clients = adapter.toClientList(entities);
assertEquals(1, clients.size());
for (Client client : clients) {
assertEquals(getClient(), client);
}
}
use of org.orcid.jaxb.model.v3.dev1.client.Client in project powerbot by powerbot.
the class DrawBoundaries method repaint.
@Override
public void repaint(final Graphics render) {
if (!ctx.game.loggedIn()) {
return;
}
final Client client = ctx.client();
final RelativeLocation r = ctx.players.local().relative();
final float rx = r.x();
final float ry = r.z();
final Component component = ctx.game.mapComponent();
final int w = component.scrollWidth();
final int h = component.scrollHeight();
final int radius = Math.max(w / 2, h / 2) + 10;
final boolean f = client.getMinimapSettings() == client.reflector.getConstant("V_MINIMAP_SCALE_ON_VALUE");
final double a = ctx.camera.rotation() * 16384d / (Math.PI * 2d);
int i = 0x3fff & (int) a;
if (!f) {
i = 0x3fff & client.getMinimapOffset() + (int) a;
}
int sin = Game.SIN_TABLE[i], cos = Game.COS_TABLE[i];
if (!f) {
final int scale = 256 + client.getMinimapScale();
sin = 256 * sin / scale;
cos = 256 * cos / scale;
}
final CollisionMap map = ctx.movement.collisionMap();
final int mapWidth = map.width() - 6;
final int mapHeight = map.height() - 6;
final Point[][] points = new Point[mapWidth][mapHeight];
final Point sp = component.screenPoint();
for (int x = 0; x < mapWidth; ++x) {
for (int y = 0; y < mapHeight; ++y) {
Point p = map(x, y, rx, ry, w, h, radius, sin, cos, sp);
if (p.x == -1 || p.y == -1) {
p = null;
}
points[x][y] = p;
}
}
final CollisionFlag collisionFlag = CollisionFlag.DEAD_BLOCK.mark(CollisionFlag.OBJECT_BLOCK);
for (int x = 1; x < mapWidth - 1; ++x) {
for (int y = 1; y < mapHeight - 1; ++y) {
final Point tl = points[x][y];
final Point tr = points[x + 1][y];
final Point br = points[x + 1][y + 1];
final Point bl = points[x][y + 1];
if (tl != null && tr != null && br != null && bl != null) {
render.setColor(map.flagAt(x, y).contains(collisionFlag) ? new Color(255, 0, 0, 50) : new Color(0, 255, 0, 50));
render.fillPolygon(new int[] { tl.x, tr.x, br.x, bl.x }, new int[] { tl.y, tr.y, br.y, bl.y }, 4);
}
}
}
}
use of org.orcid.jaxb.model.v3.dev1.client.Client in project powerbot by powerbot.
the class Component method getInternalComponent.
private Widget getInternalComponent() {
if (index < 0 || widget.id() < 1) {
return null;
}
final Object[] components;
if (parent != null) {
final Widget parentComponent = parent.getInternalComponent();
components = parentComponent != null ? parentComponent.getComponents() : null;
} else {
components = widget.getInternalComponents();
}
final Client c = ctx.client();
return c != null && components != null && index < components.length ? new Widget(c.reflector, components[index]) : null;
}
Aggregations