Exemple #1
0
/*
 * Class:     mapnik_Layer
 * Method:    setAbstract
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setAbstract
(JNIEnv *env, jobject layerobj, jstring sj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	refjavastring s(env, sj);
	layer->set_abstract(s.stringz);
}
Exemple #2
0
/*
 * Class:     mapnik_Layer
 * Method:    isCacheFeatures
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_mapnik_Layer_isCacheFeatures
(JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return (jboolean)layer->cache_features();
	TRAILER(false);
}
Exemple #3
0
/*
 * Class:     mapnik_Layer
 * Method:    setClearLabelCache
 * Signature: (Z)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setClearLabelCache
(JNIEnv *env, jobject layerobj, jboolean b)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->set_clear_label_cache((bool)b);
	TRAILER_VOID;
}
Exemple #4
0
/*
 * Class:     mapnik_Layer
 * Method:    isClearLabelCache
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_mapnik_Layer_isClearLabelCache
(JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return (jboolean)layer->clear_label_cache();
	TRAILER(false);
}
Exemple #5
0
/*
 * Class:     mapnik_Layer
 * Method:    isVisible
 * Signature: (D)Z
 */
JNIEXPORT jboolean JNICALL Java_mapnik_Layer_isVisible
  (JNIEnv *env, jobject layerobj, jdouble scale)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return layer->isVisible(scale);
	TRAILER(false);
}
Exemple #6
0
/*
 * Class:     mapnik_Layer
 * Method:    setQueryable
 * Signature: (Z)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setQueryable
(JNIEnv *env, jobject layerobj, jboolean b)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->setQueryable((bool)b);
	TRAILER_VOID;
}
Exemple #7
0
/*
 * Class:     mapnik_Layer
 * Method:    isQueryable
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_mapnik_Layer_isQueryable
(JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return (jboolean)layer->isQueryable();
	TRAILER(false);
}
Exemple #8
0
/*
 * Class:     mapnik_Layer
 * Method:    setCacheFeatures
 * Signature: (Z)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setCacheFeatures
(JNIEnv *env, jobject layerobj, jboolean b)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->set_cache_features((bool)b);
	TRAILER_VOID;
}
Exemple #9
0
/*
 * Class:     mapnik_Layer
 * Method:    getMaxZoom
 * Signature: ()D
 */
JNIEXPORT jdouble JNICALL Java_mapnik_Layer_getMaxZoom
(JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return layer->getMaxZoom();
	TRAILER(0);
}
Exemple #10
0
/*
 * Class:     mapnik_Layer
 * Method:    getAbstract
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_mapnik_Layer_getAbstract
(JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return env->NewStringUTF(layer->abstract().c_str());
	TRAILER(0);
}
Exemple #11
0
/*
 * Class:     mapnik_Layer
 * Method:    setMaxZoom
 * Signature: (D)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setMaxZoom
(JNIEnv *env, jobject layerobj, jdouble z)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->setMaxZoom(z);
	TRAILER_VOID;
}
Exemple #12
0
/*
 * Class:     mapnik_Layer
 * Method:    setTitle
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setTitle
(JNIEnv *env, jobject layerobj, jstring sj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	refjavastring s(env, sj);
	layer->set_title(s.stringz);
	TRAILER_VOID;
}
Exemple #13
0
/*
 * Class:     mapnik_Layer
 * Method:    getDatasource
 * Signature: ()Lmapnik/Datasource;
 */
JNIEXPORT jobject JNICALL Java_mapnik_Layer_getDatasource
  (JNIEnv *env, jobject layerobj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	mapnik::datasource_ptr ds=layer->datasource();
	if (!ds) return 0;

	mapnik::datasource_ptr* dspinned=new mapnik::datasource_ptr(ds);
	jobject ret=env->AllocObject(CLASS_DATASOURCE.java_class);
	env->SetLongField(ret, CLASS_DATASOURCE.ptr_field, FROM_POINTER(dspinned));

	return ret;
}
Exemple #14
0
/*
 * Class:     mapnik_Layer
 * Method:    setDatasource
 * Signature: (Lmapnik/Datasource;)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setDatasource
  (JNIEnv *env, jobject layerobj, jobject dsobject)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);

	if (!dsobject) {
		layer->set_datasource(mapnik::datasource_ptr());
		return;
	}

	mapnik::datasource_ptr* dspinned=
			static_cast<mapnik::datasource_ptr*>(
					TO_POINTER(env->GetLongField(dsobject, CLASS_DATASOURCE.ptr_field)));
	layer->set_datasource(*dspinned);
}
Exemple #15
0
/*
 * Class:     mapnik_Layer
 * Method:    getDatasource
 * Signature: ()Lmapnik/Datasource;
 */
JNIEXPORT jobject JNICALL Java_mapnik_Layer_getDatasource
  (JNIEnv *env, jobject layerobj)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	mapnik::datasource_ptr ds=layer->datasource();
	if (!ds) return 0;

	mapnik::datasource_ptr* dspinned=new mapnik::datasource_ptr(ds);
	jobject ret=env->NewObject(CLASS_DATASOURCE, CTOR_NATIVEOBJECT);
	env->SetLongField(ret, FIELD_PTR, FROM_POINTER(dspinned));

	return ret;
	TRAILER(0);
}
Exemple #16
0
/*
 * Class:     mapnik_Layer
 * Method:    setStyles
 * Signature: ([Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setStyles
  (JNIEnv *env, jobject layerobj, jobjectArray ary)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	std::vector<std::string> &styles(layer->styles());
	styles.clear();

	if (ary) {
		jsize size=env->GetArrayLength(ary);
		for (jsize i=0; i<size; i++) {
			jobject element=env->GetObjectArrayElement(ary, i);
			refjavastring s(env, (jstring)element);
			styles.push_back(s.stringz);
		}
	}
}
Exemple #17
0
/*
 * Class:     mapnik_Layer
 * Method:    setDatasource
 * Signature: (Lmapnik/Datasource;)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setDatasource
  (JNIEnv *env, jobject layerobj, jobject dsobject)
{
	PREAMBLE;
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);

	if (!dsobject) {
		layer->set_datasource(mapnik::datasource_ptr());
		return;
	}

	mapnik::datasource_ptr* dspinned=
			static_cast<mapnik::datasource_ptr*>(
					TO_POINTER(env->GetLongField(dsobject, FIELD_PTR)));
	layer->set_datasource(*dspinned);
	TRAILER_VOID;
}
Exemple #18
0
/*
 * Class:     mapnik_Layer
 * Method:    getStyles
 * Signature: ()[Ljava/lang/String;
 */
JNIEXPORT jobjectArray JNICALL Java_mapnik_Layer_getStyles
  (JNIEnv *env, jobject layerobj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	std::vector<std::string> &styles(layer->styles());

	jobjectArray ary=env->NewObjectArray(
			styles.size(),
			CLASS_STRING,
			(jobject)0);

	for (unsigned i=0; i<styles.size(); i++) {
		env->SetObjectArrayElement(ary, i,
				env->NewStringUTF(styles[i].c_str()));
	}

	return ary;
}
Exemple #19
0
/*
 * Class:     mapnik_Layer
 * Method:    getTitle
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_mapnik_Layer_getTitle
(JNIEnv *env, jobject layerobj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return env->NewStringUTF(layer->title().c_str());
}
Exemple #20
0
/*
 * Class:     mapnik_Layer
 * Method:    setActive
 * Signature: (Z)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setActive
  (JNIEnv *env, jobject layerobj, jboolean b)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->setActive((bool)b);
}
Exemple #21
0
/*
 * Class:     mapnik_Layer
 * Method:    isActive
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_mapnik_Layer_isActive
(JNIEnv *env, jobject layerobj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return (jboolean)layer->isActive();
}
Exemple #22
0
/*
 * Class:     mapnik_Layer
 * Method:    setMinZoom
 * Signature: (D)V
 */
JNIEXPORT void JNICALL Java_mapnik_Layer_setMinZoom
  (JNIEnv *env, jobject layerobj, jdouble z)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	layer->setMinZoom(z);
}
Exemple #23
0
/*
 * Class:     mapnik_Layer
 * Method:    getMinZoom
 * Signature: ()D
 */
JNIEXPORT jdouble JNICALL Java_mapnik_Layer_getMinZoom
(JNIEnv *env, jobject layerobj)
{
	mapnik::layer* layer=LOAD_LAYER_POINTER(layerobj);
	return layer->getMinZoom();
}