예제 #1
0
int main(int argc, const char* argv[]) {
	if(argc < 2) {
		printHelp();
	}
	const string func = getArg(argc, argv, 1);
	if(func.compare("help") == 0) {
		printHelp();
	} else if(func.compare("activemqSend") == 0) {
		const string brokerURI = getArg(argc, argv, 2);
		const bool destType = getDestType(getArg(argc, argv, 3));
		const string dest = getArg(argc, argv, 4);
		const string message = getArg(argc, argv, 5);
		mql4j::activemqSend(brokerURI, destType, dest , message);
	} else if(func.compare("activemqRecv") == 0) {
		const string brokerURI = getArg(argc, argv, 2);
		const bool destType = getDestType(getArg(argc, argv, 3));
		const string dest = getArg(argc, argv, 4);
		mql4j::activemqRecv(brokerURI, destType, dest);
	} else if(func.compare("jvmStart") == 0) {
		mql4j::jvmStart();
	} else {
		printHelp();
	}
	return 0;
}
예제 #2
0
void QMapViewWidget::mouseReleaseEvent(QMouseEvent *event) {
	mouseMoveEvent(event);

	switch (pMode) {
		case 0: {
			if (pNewTokenType) {
				pMap[(int)pNewToken.y()][(int)pNewToken.x()] = pNewTokenType;
				pNewTokenType = 0;
				redrawMap();
				update();
			}
		}
			break;
		case 1: {
			if (pSelDir) {				
				pNewTokenType = getTokenType(pMap[pSelToken.y()][pSelToken.x()]);
				pNewToken = pSelToken;
				pMap[pSelToken.y()][pSelToken.x()] = getDestType(pMap[pSelToken.y()][pSelToken.x()]);

				pSelToken = getEndPointOfMovement(pMap, pNewToken.toPoint(), pSelDir);
				
				QCustomVariantAnimator *animation = new QCustomVariantAnimator();
				animation->setStartValue(pNewToken);
				animation->setEndValue(pSelToken);
				animation->setDuration(500);
				animation->setEasingCurve(QEasingCurve::InOutCubic);
				connect(animation, SIGNAL(valueChanged(const QVariant&)), this, SLOT(performAnimation(const QVariant&)));
				connect(animation, SIGNAL(finished()), this, SLOT(performAnimationFinished()));
				pIsAnimationRun = true;
				animation->start(QAbstractAnimation::DeleteWhenStopped);
				redrawMap();
			}
			else {
				pNewTokenType = 0;
			}

			pSelDir = 0;
			update();
		}
			break;
		default:
			break;
	}